root-hunter/zig-search
High-performance search utility written entirely in Zig
This is my first project written in Zig. I've been fascinated by Zig and its features, which offer a unique blend of performance, simplicity, and control. Zig-Search is a testament to the power and efficiency that Zig brings to the table, and it has been an exciting journey exploring what this language can do. I hope this tool showcases the potential of Zig and inspires others to explore it as well.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
These are the prerequisites needed only to build the project, if you only want to use zig-search you can go to the Usage section
git clone https://github.com/root-hunter/zig-search
cd zig-search
make build-exe
or
zig build-exe src/main.zig --name zig-search -static
Search and export into file all path of files (with extension .txt) that contains the word "password" at least one time.
zig-search /start/path "password" -f txt -e ${HOME}/Documents/zig-search_result.txt
Search and export into file all path of files (with extension .txt, .js, .html) that contains the word "password" at least one time.
zig-search /start/path "password" -f txt,js,html -e ${HOME}/Documents/zig-search_result.txt
Search and export into file all path of files (with extension .txt) that contains the word "password" at least one time using 16 threads.
zig-search /start/path "password" -f txt -t 16 -e ${HOME}/Documents/zig-search_result.txt
Search and export into file all path of files (with extension .txt) that contains the word "password" at least one time using all possible threads.
zig-search /start/path "password" -f txt -t 0 -e ${HOME}/Documents/zig-search_result.txt
Only print paths to console without export result file (using all cpu core).
zig-search /start/path "password" -f txt -t 0
Active case sensitive search.
zig-search /start/path "Password" -f txt -t 0 -c
Help command.
zig-search --help
Usage: zig-search START_PATH SEARCH_STRING [OPTIONS]...
Options:
--help Help command
-f, --file-extensions File extensions, in this form: txt,js | js,c,cpp
-t, --thread-count Scan thread count (Default: 1)
-a, --all-match Match all the occurence in the file (Default: false)
-c, --case-sensitive Case sensitive search (Default: false)
Export options:
-e, --export-path File export path (ABSOLUTE)
--export-no-info Disable info header in the export file
--export-match-position Add match position info for each path in the export file
Distributed under the MIT License. See LICENSE
for more information.