xzgrep
Search xz compressed files with grep
TLDR
Search for a pattern in an xz-compressed file
$ xzgrep "[pattern]" [file.xz]
Search case-insensitivelycopy
$ xzgrep -i "[pattern]" [file.xz]
Count matching linescopy
$ xzgrep -c "[pattern]" [file.xz]
Show line numbers with matchescopy
$ xzgrep -n "[pattern]" [file.xz]
List files containing a matchcopy
$ xzgrep -l "[pattern]" [*.xz]
Search using extended regular expressionscopy
$ xzgrep -E "[regex_pattern]" [file.xz]
copy
SYNOPSIS
xzgrep [options] pattern [files...]
DESCRIPTION
xzgrep searches xz, lzma, and lzip compressed files for lines matching a pattern. It decompresses the data on the fly and passes it to grep, without creating temporary files on disk. All standard grep options are supported. Also available as xzegrep and xzfgrep variants.
PARAMETERS
-i
Case insensitive search.-n
Show line numbers.-c
Count matching lines.-l
List only filenames containing matches.-v
Invert match (show non-matching lines).-E
Use extended regular expressions (like egrep).-F
Use fixed strings instead of regular expressions (like fgrep).-h
Suppress filename prefix on output.-H
Always print filename prefix.