LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lzegrep

searches for extended regular expression patterns in lzip-compressed files

TLDR

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

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
copy
sudo pacman -S xz
copy
sudo apk add xz
copy
sudo zypper install xz
copy
brew install xz
copy
nix profile install nixpkgs#xz
copy

SEE ALSO

lzgrep(1), egrep(1)

Copied to clipboard
Kai