pjgrep
is a fast and flexible pattern searching tool designed to search for specific patterns within files and directories. It supports searching for patterns in filenames and file contents and allows you to filter by file extensions. This tool is lightweight, highly customizable, and works cross-platform.
- Search for patterns in file names and file content.
- Support for filtering files by extension (e.g.,
.txt
,.md
,.rs
). - Provides counts for how many times a pattern appears in the content.
- Color-coded output for better readability.
- Cross-platform support (Linux, macOS, Windows).
- Fast search through directories and subdirectories.
To use pjgrep
, you need to have Rust installed. You can install it using the following steps:
-
Install Rust (if not already installed):
- Follow the instructions on the official Rust installation page.
- On most systems, you can install it via the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Clone the Repository: Clone this repository to your local machine:
git clone https://github.com/rezkhaleghi/pj-grep.git cd pj-grep
-
Build the Project: Build the pjgrep application with the following command:
cargo build --release
-
Install the Binary: Optionally, you can copy the binary to a directory in your
$PATH
(e.g.,/usr/local/bin
or~/bin
) for easy access:sudo cp target/release/pjgrep /usr/local/bin/pjgrep
pjgrep <pattern> [directory] [--format=<ext1,ext2,...>]
<pattern>
: The pattern to search for.[directory]
: The directory to search in (optional, defaults to the current directory).[--format=<txt,json,ts,env,...>]
: A comma-separated list of file extensions to filter by (optional).
pjgrep "example"
pjgrep "example" /path/to/directory
pjgrep "example" /path/to/directory --format=rs,txt,md
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Created and maintained by "PocketJack (Rez Khaleghi)"
- GitHub: https://github.com/rezkhaleghi
- Email: rezaxkhaleghi@gmail.com
This project is licensed under the MIT License. See the LICENSE file for details.