sik is a simple, fast, and concurrent command-line tool for searching patterns within files in a given directory. It is written in Rust and leverages multi-threading to perform searches efficiently.
- Concurrent Searching: Utilizes multiple threads to search files in parallel, making it fast on modern multi-core processors.
- Simple and Intuitive: Easy to use with a minimal set of command-line arguments.
- Cross-Platform: Built with Rust, it can be compiled and run on Windows, macOS, and Linux.
This project uses the following external crate:
regex: For regular expression based pattern matching.
To build and run sik, you need to have the Rust programming language toolchain installed. You can install it from rust-lang.org.
-
Clone the repository:
git clone https://github.com/mi66mc/sik.git cd sik -
Build the project: For a development build, run:
cargo build
For a release build (recommended for performance), run:
cargo build --release
The executable will be located at
target/release/sik.
The basic syntax for sik is:
sik [OPTIONS] <PATTERN> [PATH]
<PATTERN>: The pattern to search for within the files, Regex is used to build the pattern. If the pattern contains spaces, it should be enclosed in quotes.[PATH]: The directory to search in. If not provided, it defaults to the current directory (.).
--primary,--secondary,--tertiary: Arguments you provide to choose what type of style you want to be displayed.-t, --threads <NUM>: Sets the number of threads to use for searching. By default, it uses twice the number of available logical processors.-h, --help: Prints the help message and exits.
-
Search for a pattern in the current directory:
sik "my_pattern" -
Search for a pattern in a specific directory:
sik "my pattern with spaces" "/path/to/your/directory"
-
Search using a specific number of threads:
sik --secondary --threads 8 "error" "./logs"
This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for more details.