grepc(1)
โจ grepc(1) โ bestie edition โจ
okay so grepc is literally that girl for digging through source code ๐
she finds declarations, definitions, and uses of whatever you're looking for. this is the grepc manual, straight from the General Commands Manual shelf, and I'm gonna walk you through it like we're texting at 2am ๐ฆ
๐ธ NAME ๐ธ
grepc โ find declarations, definitions, and uses in source code
no cap, that's the whole job. three vibes: decl, def, use. she does all three. ๐
๐ SYNOPSIS ๐
grepc [option ...] pattern [file ...]
โจ DESCRIPTION โจ
grepc(1) goes hunting for declarations, definitions, and/or uses of pattern inside each source file you hand her. she's thorough like that ๐
pattern is a PCRE pattern. normally it's standing in for an identifier, and in most cases the program implicitly adds word boundaries around it โ so you don't have to be all fussy about it, she's got you ๐ซถ
if you don't give her any file, she reads standard input. otherwise she reads every file you list, and if you point her at directories she searches them recursively โ but note: she does not follow symbolic links. periodt. ๐ซ๐
๐ OPTIONS ๐
-A nโ print n lines of trailing context after a match. afterparty content ๐-B nโ print n lines of leading context before a match. the pregame โจ-C nโ print n lines of context surrounding a match. both sides, balanced queen โ๏ธ-cโ don't print the matches themselves, just print a count of them instead. receipts only ๐งพ-hโ suppress prefixing file names on output. no name-dropping ๐-iโ ignore case distinctions in pattern. she's not gonna judge your caps lock ๐-lโ suppress normal output; instead print the name of each input file that would have produced output. and heads up: each file is only printed once, no repeats bestie ๐-m nโ stop processing after finding n matches. she knows when to log off ๐-nโ prefix each line of output with the 1-based line number within its input file. so you can find your way back ๐-t typeโ restrict the search to a specific type of code. you can pass this option multiple times to search various types of code. the acceptable values depend on the driver used for the language โ checkgrepc_c(1), which is the default driver. pick your fighter ๐ฅ
๐ญ CAVEATS ๐ญ
๐ Crashes
soโฆ in some cases, internal calls to pcre2grep(1) may fail after consuming too much resources. yeah. she ate too hard and passed out ๐ญ
to solve that, use -t to restrict the types of code of your search. that's the fix, bestie.
๐ซฃ Seekable files
files given on the command line must be seekable and able to be opened twice. if you need to read a non-seekable file, just redirect it to standard input instead. she needs her space to work, ok?? ๐ง
๐ EXAMPLES ๐
alx@devuan:/usr/lib/gcc$ grepc -n alignof .;
./x86_64-linux-gnu/15/include/stdalign.h:33:#define alignof _Alignof
look at her go. found it, numbered it, slayed it. ๐ฅ
๐ SEE ALSO ๐
grepc_c(1), pcre2grep(1), pcre2syntax(3), pcre2pattern(3)
and that's the whole page, babes ๐ this lil masterpiece is from Linux man-pages 6.20, dated 2025-11-09, and it is the grepc(1) manual โ go forth and grep, you main character ๐๐๐
๐ฆ where this page comes from
- arch rolling: man-pages-utils 6.20-1 ยท GPL-3.0-or-later
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: Linux-man-pages-copyleft
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms