1
1
Fork
You've already forked cgrep
0
cgrep is a tool to search for files with specific words or search for certain words within a file
  • C++ 96%
  • Makefile 4%
Find a file
2026年06月14日 13:22:27 +00:00
src init commit 2026年06月14日 12:40:14 +00:00
.gitignore add .gitignore 2026年06月14日 12:42:01 +00:00
Makefile fixed Makefile 2026年06月14日 13:22:27 +00:00
README.md add README.md 2026年06月14日 12:41:26 +00:00

cgrep

Fast grep clone written in C++ with multithreading support.

Build

make
sudo make install

Usage

cgrep [OPTIONS] PATTERN [FILE...]

Options

Option Description -i, --ignore-case Case insensitive search -r, --recursive Search directories recursively -n, --no-line-numbers Hide line numbers -c, --count Show match count only -v, --invert-match Show non-matching lines -e, --regex Pattern is regex -t, --threads N Use N threads --no-color Disable colored output -h, --help Show help

Examples

# Basic search
cgrep "error" app.log
# Case insensitive
cgrep -i "warning" *.log
# Recursive search
cgrep -r "TODO" ./src
# Count matches
cgrep -c "function" *.js
# Regex pattern
cgrep -e "[0-9]{3}-[0-9]{4}" data.txt
# Pipe from stdin
cat file.txt | cgrep "pattern"
# Multithreaded search
cgrep -t 4 "import" *.py
# Invert match
cgrep -v "debug" server.log

Requirements

· C++17 compiler · pthread

License

GPL v1