2025-03-14 21:59:59 -06:00
|
|
|
# bzfgrep
|
|
|
|
|
|
|
|
|
|
> Find any fixed strings separated by new lines in `bzip2` compressed files using `fgrep`.
|
|
|
|
|
> More information: <https://manned.org/bzfgrep>.
|
|
|
|
|
|
|
|
|
|
- Search for lines matching the list of search strings separated by new lines in a compressed file (case-sensitive):
|
|
|
|
|
|
|
|
|
|
`bzfgrep "{{search_string}}" {{path/to/file}}`
|
|
|
|
|
|
|
|
|
|
- Search for lines matching the list of search strings separated by new lines in a compressed file (case-insensitive):
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`bzfgrep {{[-i|--ignore-case]}} "{{search_string}}" {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Search for lines that do not match the list of search strings separated by new lines in a compressed file:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`bzfgrep {{[-v|--invert-match]}} "{{search_string}}" {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Print file name and line number for each match:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`bzfgrep {{[-H|--with-filename]}} {{[-n|--line-number]}} "{{search_string}}" {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Search for lines matching a pattern, printing only the matched text:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`bzfgrep {{[-o|--only-matching]}} "{{search_string}}" {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Recursively search files in a bzip2 compressed tar archive for the given list of strings:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`bzfgrep {{[-r|--recursive]}} "{{search_string}}" {{path/to/file}}`
|