← 返回命令列表

Linux command

xzfgrep 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Search fixed string in xz files

xzfgrep "[string]" [file.xz]

Search multiple strings

xzfgrep -e "[str1]" -e "[str2]" [file.xz]

Case-insensitive search

xzfgrep -i "[string]" [file.xz]

Count matching lines

xzfgrep -c "[string]" [file.xz]

Show line numbers

xzfgrep -n "[string]" [file.xz]

说明

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.

FAQ

What is the xzfgrep command used for?

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.

How do I run a basic xzfgrep example?

Run `xzfgrep "[string]" [file.xz]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more xzfgrep examples?

This page includes 5 examples for xzfgrep, plus related commands for nearby Linux tasks.