Forrest logo
tool overview
On this page you find all important commands for the CLI tool bzgrep. If the command you are looking for is missing please ask our AI.

bzgrep

bzgrep is a command line tool used to search for patterns or specific text within compressed files that have been created using the bzip2 compression algorithm. It is an extension of the standard Unix grep tool, designed specifically for working with bzip2 compressed data.

To use bzgrep, you specify the pattern you are searching for and the compressed file you want to search within as command line arguments. bzgrep then decompresses and searches the file, displaying any matching lines. It supports regular expressions and works similarly to grep, providing options for case-insensitive searches, displaying line numbers, and more.

bzgrep is particularly useful when working with large compressed files, as it allows you to search within them without having to first decompress the entire file. It saves time and disk space by only decompressing and processing the necessary parts of the file based on the search pattern provided.

Overall, bzgrep is a powerful tool for searching within bzip2 compressed files efficiently and easily from the command line.

List of commands for bzgrep:

  • bzgrep:tldr:03b72 bzgrep: Search for a pattern within a compressed file.
    $ bzgrep "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzgrep:tldr:6b089 bzgrep: Recursively search files in a bzip2 compressed tar archive for a pattern.
    $ bzgrep --recursive "${search_pattern}" ${path-to-tar-file}
    try on your machine
    explain this command
  • bzgrep:tldr:a9fbb bzgrep: Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode.
    $ bzgrep --extended-regexp --ignore-case "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzgrep:tldr:ab752 bzgrep: Search for lines matching a pattern, printing only the matched text.
    $ bzgrep --only-matching "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzgrep:tldr:e7c3a bzgrep: Print 3 lines of context around, before, or after each match.
    $ bzgrep --${select}=${3} "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzgrep:tldr:fef8d bzgrep: Print file name and line number for each match.
    $ bzgrep --with-filename --line-number "${search_pattern}" ${filename}
    try on your machine
    explain this command
tool overview