Linux command
bzgrep 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Search
bzgrep ["pattern"] [file.bz2]
Case-insensitive
bzgrep -i ["error"] [log.bz2]
Count
bzgrep -c ["pattern"] [file.bz2]
Show
bzgrep -n ["pattern"] [file.bz2]
说明
bzgrep invokes grep on bzip2-compressed files. If no file is specified, standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. When invoked as bzegrep or bzfgrep, egrep or fgrep is used instead of grep. The grep program can also be overridden via the GREP environment variable.
参数
- -i
- Case-insensitive search
- -v
- Invert match
- -n
- Show line numbers
- -c
- Count matches
- -l
- List matching files
- -e _pattern_
- Use pattern as the search pattern (useful for patterns starting with -)
- -H
- Print filename
- -h
- Suppress filename
FAQ
What is the bzgrep command used for?
bzgrep invokes grep on bzip2-compressed files. If no file is specified, standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. When invoked as bzegrep or bzfgrep, egrep or fgrep is used instead of grep. The grep program can also be overridden via the GREP environment variable.
How do I run a basic bzgrep example?
Run `bzgrep ["pattern"] [file.bz2]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -i do in bzgrep?
Case-insensitive search