Skip to content

DarkCeptor44/grep-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grep-rs

madewith

grep but cross-platform and in Rust.

Features

  • Basic search (case-insensitive by default)
  • Case-sensitive search
  • Line numbers
  • Count (-c)
  • Regex
  • Glob

Installation

  • 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 .

Usage

$ 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>

Benchmarks

The benchmarks were performed using Hyperfine.

Windows

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

Linux

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

License

This project is licensed under the terms of the GNU General Public License version 3.

About

grep made in Rust

Topics

Resources

License

Stars

Watchers

Forks

Languages