grep but cross-platform and in Rust.
- Basic search (case-insensitive by default)
- Case-sensitive search
- Line numbers
- Count (
-c
) - Regex
- Glob
- From crates.io: TBD
- From GitHub:
cargo install --git https://github.com/DarkCeptor44/grep-rs
- From releases.
- Manually:
git clone https://github.com/DarkCeptor44/grep-rs.git
cd grep-rs
cargo install --path .
$ grep-rs -h
grep but in Rust
Usage: grep-rs [OPTIONS] <PATTERN> [PATH]
Arguments:
<PATTERN> The pattern to search for
[PATH] The path to the file
Options:
-C, --case-sensitive Use case-sensitive search
-l, --line-numbers Show line numbers
-c, --color <COLOR> The color to use for highlighting (off for no color) [default: blue]
-h, --help Print help
-V, --version Print version
$ grep-rs 2025 LICENSE
{{ project }} Copyright (C) 2025 <organization>
$ cat LICENSE | grep-rs 2025
{{ project }} Copyright (C) 2025 <organization>
The benchmarks were performed using Hyperfine.
AMD64, 32GB RAM, Ryzen 7 3800X, Windows 10.
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
target\release\grep-rs.exe 2025 LICENSE |
6.0 ± 0.5 | 5.3 | 7.7 | 1.00 |
findstr 2025 LICENSE |
7.9 ± 0.9 | 6.8 | 11.7 | 1.30 ± 0.18 |
ARM64, 1GB RAM, Orange Pi Zero2, Debian 12.
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
target/release/grep-rs 2025 LICENSE |
2.6 ± 0.2 | 2.2 | 3.6 | 1.09 ± 0.12 |
grep 2025 LICENSE |
2.4 ± 0.2 | 2.1 | 3.1 | 1.00 |
This project is licensed under the terms of the GNU General Public License version 3.