BATGREP(1)
π NAME π
batgrep β Quickly search through and highlight files using ripgrep. That's the whole vibe, bestie. This is BATGREP(1) from the General Commands Manual, and we're about to break it all the way down. π«Ά
β¨ DESCRIPTION β¨
Okay so here's the tea: batgrep searches through files or directories looking for matching regular expressions (or fixed strings with -F), and prints the output using bat for an easy and syntax-highlighted experience. π
β¨
It's giving "search but make it pretty," and honestly? Obsessed. π
π«Ά USAGE π«Ά
batgrep [OPTIONS] PATTERN [PATH...]
That's the shape of it: options first, then the pattern, then the paths. Slay. πΈ
π OPTIONS π
πΈ Options this script handles itself πΈ
-i,--ignore-caseβ use case insensitive searching. It's not gonna be picky about uppercase vs. lowercase, bestie. π¦-s,--case-sensitiveβ use case sensitive searching. Exact-case energy only. π-S,--smart-caseβ use smart case searching. The smartest little search vibe. β¨-A,--after-context=[LINES]β display the next n lines after a matched line. Peek after the match, periodt. π-B,--before-context=[LINES]β display the previous n lines before a matched line. Peek before the match, no cap. π-C,--context=[LINES]β a combination of--after-contextand--before-context. Both sides, bestie. π«Ά-p,--search-patternβ tell pager to search forPATTERN. Currently supported pagers:less. π§--no-followβ do not follow symlinks. Leave those links where they are. π«--no-snipβ do not show the snip decoration. This is automatically enabled when--context=0or whenbat --versionis less than0.12.x. π--no-highlightβ do not highlight matching lines. This is automatically enabled when--context=0. π--colorβ force color output. Make it pop. π--no-colorβ force disable color output. Monochrome mode activated. π€--paging=["never"/"always"]β enable/disable paging. You either page or you don't, bestie. π--pager=[PAGER]β specify the pager to use. Put your fave in charge. π«Ά--terminal-width=[COLS]β generate output for the specified terminal width. Fit the vibe to your window. π--no-separatorβ disable printing separator between files. No little divider moment. βοΈ--rgaβ useripgrep-allinstead ofripgrep. A whole different search bestie. π₯
π¦ Options passed directly to ripgrep π¦
The following options are passed directly to ripgrep, and are not handled by this script. That's the rule, no cap. π«Ά
-F,--fixed-stringsβ passed straight through toripgrep; no extra note in the table. π¦-U,--multilineβ passed straight through toripgrep; no extra note in the table. πΈ-P,--pcre2β passed straight through toripgrep; no extra note in the table. β¨-z,--search-zipβ passed straight through toripgrep; no extra note in the table. π-w,--word-regexpβ passed straight through toripgrep; no extra note in the table. π--one-file-systemβ passed straight through toripgrep; no extra note in the table. π--multiline-dotallβ passed straight through toripgrep; no extra note in the table. β--ignore/--no-ignoreβ passed straight through toripgrep; no extra note in the table. π--crlf/--no-crlfβ passed straight through toripgrep; no extra note in the table. π--hidden/--no-hiddenβ passed straight through toripgrep; no extra note in the table. π-E,--encodingβ passed straight through toripgrep. β οΈ This is unsupported bybat, and may cause issues when trying to display unsupported encodings. π-g,--globβ passed straight through toripgrep; no extra note in the table. π§-t,--typeβ passed straight through toripgrep; no extra note in the table. π-T,--type-notβ passed straight through toripgrep; no extra note in the table. π¦-m,--max-countβ passed straight through toripgrep; no extra note in the table. π₯--max-depthβ passed straight through toripgrep; no extra note in the table. πΈ--iglobβ passed straight through toripgrep; no extra note in the table. π--ignore-fileβ passed straight through toripgrep; no extra note in the table. β¨
π CAVEATS π
Differences from ripgrep, bestie:
--followis enabled by default forbatgrep. π- Not all the
ripgrepoptions are supported. Periodt. π
That's the whole BATGREP(1) page from the General Commands Manual, bestie. π«Ά The footer vibe is just BATGREP(1) again, and there's no separate source/version/date line to copy in the original, so we're not inventing one β periodt. π
β¨
π¦ where this page comes from
- arch rolling: bat-extras 2024.08.24-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms