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.
- 100% Zig implementation
- Only std lib
- Fast and efficient directory scanning
- Recursive search in nested directories
- Simple command-line interface
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
- Clone the repo
git clone https://github.com/root-hunter/zig-search- Move to zig-search dir
cd zig-search- Build executable
make build-exeor
zig build-exe src/main.zig --name zig-search -staticSearch 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.txtSearch 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.txtSearch 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.txtSearch 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.txtOnly print paths to console without export result file (using all cpu core).
zig-search /start/path "password" -f txt -t 0Active case sensitive search.
zig-search /start/path "Password" -f txt -t 0 -cHelp 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- Help command
- Multihreading
- Advance text search
- Export results to file
- Scan file by list file paths
Distributed under the MIT License. See LICENSE for more information.