LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

xzfgrep

Search compressed files for fixed strings

TLDR

Search fixed string in xz files
$ xzfgrep "[string]" [file.xz]
copy
Search multiple strings
$ xzfgrep -e "[str1]" -e "[str2]" [file.xz]
copy
Case-insensitive search
$ xzfgrep -i "[string]" [file.xz]
copy
Count matching lines
$ xzfgrep -c "[string]" [file.xz]
copy
Show line numbers
$ xzfgrep -n "[string]" [file.xz]
copy

SYNOPSIS

xzfgrep [option...] [pattern] [file...]

DESCRIPTION

xzfgrep searches compressed files for fixed strings. It is equivalent to xzgrep -F, meaning patterns are not interpreted as regular expressions. This makes it faster than xzgrep for literal string searches.The file compression format is detected from the filename suffix. Files compressed with xz, lzma, gzip, bzip2, lzop, zstd, or lz4 are automatically decompressed before searching. Unrecognized suffixes are assumed to be uncompressed.All options are passed directly to grep(1). The options -r, -R, -d, -Z, and -z are not supported.When no file is specified, standard input is read. From standard input, only xz-compressed data is supported.

SEE ALSO

xzgrep(1), xzegrep(1), xz(1), fgrep(1), grep(1), zgrep(1), zfgrep(1)

Copied to clipboard
Kai