Replace, Preprocess, and Encodings/Search compressed files

Enable searching in common compressed formats.

Section: Preprocessors and compressed files

Search compressed files

bash
bash
rg -z 'Exception' logs/
Explanation

`-z` lets ripgrep inspect gzip, xz, bzip2, lz4, brotli, and similar compressed inputs when supported.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Preprocessors and compressed files
Use a preprocessor for unsupported formats
Transform file content before ripgrep searches it.
OpenIn sheetbashsame section
Apply preprocessing only to certain files
Limit preprocessors to matching paths.
OpenIn sheetbashsame section
Combine archive tools with rg
Expand an archive stream and search it.
OpenIn sheetbashsame section
Search binary-ish files as text
Treat binary files as text input.
OpenIn sheetbashsame section
Preview a simple replacement
Show what matched lines would look like after substitution.
OpenIn sheetbash1 tag match
Search a UTF-16LE file
Decode a file using a specific encoding.
OpenIn sheetbash1 tag match