lzegrep

searches for extended regular expression patterns in lzip-compressed files

TLDR

Search with extended regex
$ lzegrep [pattern] [file.lz]
Case-insensitive search
$ lzegrep -i [pattern] [file.lz]
Show line numbers
$ lzegrep -n [pattern] [file.lz]

SYNOPSIS

lzegrep [options] pattern [file...]

DESCRIPTION

lzegrep searches for extended regular expression patterns in lzip-compressed files. It is equivalent to lzgrep -E and internally pipes decompressed data through grep -E (or egrep). Uncompressed files are searched directly.

PARAMETERS

-i

Case-insensitive matching.
-n
Prefix each matching line with its line number.
-v
Invert match; show lines that do not match.
-c
Print only the count of matching lines per file.
-l
Print only the names of files containing matches.
-h
Suppress file name prefixes in output.
-H
Force file name prefixes in output.
-e PATTERN
Use PATTERN as the search pattern; useful for multiple patterns.

INSTALL

sudo dnf install xz
sudo pacman -S xz
sudo apk add xz
sudo zypper install xz
brew install xz
nix profile install nixpkgs#xz

SEE ALSO

lzgrep(1), egrep(1)