> For the complete documentation index, see [llms.txt](https://linux-tutorial-cli.gitbook.io/linux-cli-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://linux-tutorial-cli.gitbook.io/linux-cli-tutorial/txt-files/bzgrep.md).

# bzgrep

## bzgrep

The bzgrep command is a command-line utility that can be used to search for text in bzip2-compressed files. It is similar to the grep command, but it can be used to search for text in compressed files.

The bzgrep command has a number of options that can be used to control the behavior of the command. Some of the most commonly used options are:

-c: This option prints the number of matches that were found. -i: This option ignores case differences when searching for text. -n: This option prints the line number of each match. -v: This option prints all lines that do not contain the specified pattern. For example, the following command will search for the text "hello" in the bzip2-compressed file file.bz2:

`bzgrep "hello" file.bz2`

The output of the bzgrep command will be a list of all the lines in the file that contain the text "hello".

## help

```
bzgrep [options] PATTERN FILE

Search for PATTERN in FILE, which may be a compressed file.

Options:

-c, --count   Print the number of matches.
-i, --ignore-case   Ignore case differences when searching for text.
-n, --line-number   Print the line number of each match.
-v, --invert-match   Print all lines that do not contain the specified pattern.
-h, --help    Display this help message.

Examples:

    bzgrep "hello" file.bz2
    bzgrep -i "hello" file.bz2
    bzgrep -c "hello" file.bz2
    bzgrep -n "hello" file.bz2
    bzgrep -v "hello" file.bz2
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://linux-tutorial-cli.gitbook.io/linux-cli-tutorial/txt-files/bzgrep.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
