LinuxCommandLibrary

xzgrep

Search xz compressed files with grep

TLDR

Search pattern in xz file

$ xzgrep "[pattern]" [file.xz]
copy
Search recursively
$ xzgrep -r "[pattern]" [directory]
copy
Count matches
$ xzgrep -c "[pattern]" [file.xz]
copy
Show line numbers
$ xzgrep -n "[pattern]" [file.xz]
copy

SYNOPSIS

xzgrep [options] pattern [files...]

DESCRIPTION

xzgrep searches xz compressed files. Decompresses and greps without creating temporary files. Supports all grep options and patterns.

PARAMETERS

-i

Case insensitive.
-n
Show line numbers.
-c
Count matches.
-l
List matching files.
-r
Recursive search.
-E
Extended regex (egrep).
-F
Fixed strings (fgrep).

SEE ALSO

xz(1), grep(1), zgrep(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community