CGREP(1)

πŸ’– CGREP(1) β€” the girlies' guide to grepping your whole index πŸ’–

okay bestie, sit down, hydrate, and let me tell you about cgrep β€” it's literally grep(1) but over all your indexed files. no cap.


✨ NAME ✨

cgrep β€” it's like grep(1), but it runs over all indexed files. yes, all of them. slay. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

cgrep [-c] [-h] [-i] [-l] [-n] regexp [ file...  ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so cgrep behaves exactly like grep, okay? it searches for regexp, which is an RE2 regular expression β€” that's "nearly PCRE," iykyk. 🧚

and the -c, -h, -i, -l, and -n flags? they work just like they do in grep. iconic behavior, no notes. BUT β€” and this is the part where you gotta pay attention, bestie β€” because of Go's flag parsing convention, you cannot combine them. the option pair -i -n can NOT be abbreviated to -in. it's giving "they have to be separate," fr fr. 😭

⚠️ don't try to be cute and smash them together. Go said no. 🚫

πŸ’… OPTIONS πŸ’…

  • -c β€” suppresses the normal output, and instead prints a count of matching lines for each input file. numbers only, main character energy. πŸ”’
  • -h β€” suppresses the prefixing of file names</> on output. sometimes you just don't need the receipts. πŸ™ˆ
  • -i β€” ignores case distinctions in both the regexp and the input files. equal opportunity matching. ✨
  • -l β€” suppresses the normal output, and instead prints the name of each input file from which output would normally have been printed. just the names, bestie. πŸ‘‘
  • -n β€” prefixes each line of output with the 1-based line number within its input file. so you always know exactly where it's at. πŸ“

🌸 ENVIRONMENT 🌸

cgrep uses the index stored in $CSEARCHINDEX β€” or, if that variable is unset or empty, it falls back to $HOME/.csearchindex. the way that it just knows where to look… obsessed. 🫢


🌈 SEE ALSO 🌈


πŸ’œ AUTHOR πŸ’œ

this manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and it may be used by others). periodt. πŸ’–


okay that's the whole thing, you're so ready. go forth and grep responsibly, queen. πŸŽ€

2013-06-23 β€” CGREP(1), General Commands Manual. bye bestie!! πŸ’œβœ¨