LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lzfgrep

Search compressed files for fixed strings

TLDR

Search for a fixed string in a compressed file
$ lzfgrep [string] [file.lz]
copy
Case-insensitive search
$ lzfgrep -i [string] [file.lz]
copy
Show line numbers with matches
$ lzfgrep -n [string] [file.lz]
copy
Count matching lines
$ lzfgrep -c [string] [file.lz]
copy
Search across multiple compressed files
$ lzfgrep [string] [file1.lz] [file2.lz]
copy
List files containing matches
$ lzfgrep -l [string] [*.lz]
copy

SYNOPSIS

lzfgrep [grepoptions] [**-e**] pattern [file_...]

DESCRIPTION

lzfgrep searches for fixed strings in files that may be compressed with xz, lzma, gzip, or bzip2. It is equivalent to lzgrep -F and is faster than regex-based search for literal string patterns. Files are automatically decompressed on the fly before searching.lzfgrep is provided as part of xz-utils for backward compatibility with LZMA Utils. If no file is specified, standard input is decompressed if necessary and fed to grep.

PARAMETERS

All options are passed directly to grep(1). Common options include:-i

Case-insensitive matching.
-n
Show line numbers.
-c
Print count of matching lines only.
-l
Print names of files with matches.
-v
Invert match (show non-matching lines).
-w
Match whole words only.
-e pattern
Specify the pattern explicitly.

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

CAVEATS

When reading from standard input, gzip and bzip2 compressed files are not supported. All options are passed directly to grep.

SEE ALSO

lzgrep(1), fgrep(1), lzegrep(1), xzgrep(1), zgrep(1), grep(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid