Linux command
lzfgrep 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Search for a fixed string
lzfgrep [string] [file.lz]
Case-insensitive search
lzfgrep -i [string] [file.lz]
Show line numbers
lzfgrep -n [string] [file.lz]
Count matching lines
lzfgrep -c [string] [file.lz]
Search across multiple
lzfgrep [string] [file1.lz] [file2.lz]
List files containing
lzfgrep -l [string] [*.lz]
说明
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.
参数
- -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.
FAQ
What is the lzfgrep command used for?
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.
How do I run a basic lzfgrep example?
Run `lzfgrep [string] [file.lz]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -i do in lzfgrep?
Case-insensitive matching.