Find patterns in
bzip2
compressed files usinggrep
. More information: https://manned.org/bzgrep.
bzgrep "search_pattern" path/to/file
?
, +
, {}
, ()
and |
), in case-insensitive mode:bzgrep --extended-regexp --ignore-case "search_pattern" path/to/file
bzgrep --context|before-context|after-context=3 "search_pattern" path/to/file
bzgrep --with-filename --line-number "search_pattern" path/to/file
bzgrep --only-matching "search_pattern" path/to/file
bzgrep --recursive "search_pattern" path/to/tar/file
stdin
for lines that do not match a pattern:cat /path/to/bz/compressed/file | bzgrep --invert-match "search_pattern"