xzgrep
Search files possibly compressed with xz, lzma, gzip, bzip2, lzop, or zstd using regex. tldr-pages
On several platforms
Several platforms
Search for a pattern within a file
xzgrep "search_pattern" path/to/fileIdentifySearch for an exact string (disables regex)
xzgrep --fixed-strings "exact_string" path/to/fileIdentifySearch for a pattern in all files showing line numbers of matches
xzgrep --line-number "search_pattern" path/to/fileIdentifyPrint 3 lines of Context around, Before, or After each match
xzgrep --context 3 "search_pattern" path/to/fileIdentifyPrint file name and line number for each match with color output
xzgrep --with-filename --line-number --color=always "search_pattern" path/to/fileIdentifySearch for lines matching a pattern, printing only the matched text
xzgrep --only-matching "search_pattern" path/to/fileIdentifyUse extended regex (supports ?, +, {}, (), and |), in case-insensitive mode
xzgrep --extended-regexp --ignore-case "search_pattern" path/to/fileIdentify