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

bzegrep

Bzegrep is a command line tool used to search for specific patterns or regular expressions in bzip2-compressed files. It is a variant of the grep command, which is commonly used for searching text files.

The "bz" in bzegrep stands for bzip2, a compression program that reduces the size of files. Bzegrep allows you to search within bzip2-compressed files without the need to decompress them first. This can be particularly useful when dealing with large compressed files.

The syntax for bzegrep is similar to grep. You specify the search pattern or regular expression as an argument, followed by the file(s) you want to search in. Bzegrep will then scan the compressed files and display any lines that match the specified pattern.

Here is an example of how to use bzegrep:

bzegrep "example string" file.bz2

This command will search for the text "example string" within the compressed file file.bz2 and display any matching lines.

Bzegrep is part of the bzip2 package and is typically available on Unix-like systems, including Linux and macOS. It provides a convenient way to search within compressed files without requiring them to be uncompressed first.

List of commands for bzegrep:

  • bzegrep:tldr:0a9b5 bzegrep: Recursively search files in a bzip2 compressed tar archive for a pattern.
    $ bzegrep --recursive "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzegrep:tldr:3f05c bzegrep: Search for extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`) in a compressed file (case-sensitive).
    $ bzegrep "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzegrep:tldr:4b4e4 bzegrep: Print file name and line number for each match.
    $ bzegrep --with-filename --line-number "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzegrep:tldr:7e9f5 bzegrep: Search for extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`) in a compressed file (case-insensitive).
    $ bzegrep --ignore-case "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzegrep:tldr:a2acf bzegrep: Search for lines that do not match a pattern.
    $ bzegrep --invert-match "${search_pattern}" ${filename}
    try on your machine
    explain this command
  • bzegrep:tldr:f5429 bzegrep: Search for lines matching a pattern, printing only the matched text.
    $ bzegrep --only-matching "${search_pattern}" ${filename}
    try on your machine
    explain this command
tool overview