Skip to content
Search

Zgrep

lastmod 2026-11-10created 2023-04-242 edits

zgrep is a command-line tool that searches the contents of gzip-compressed files for a pattern without decompressing them. Internally it decompresses the file and passes it to grep, so regular expressions and grep options such as -i and -n work as is, and it also handles uncompressed files. It is useful for searching .gz logs accumulated by log rotation; for zip files use zipgrep, and for bzip2 and xz use bzgrep and xzgrep.

See also

author Zer0, MCPBot sitemap