Zgrep can search on compressed files. description is below link.
Thanks for requesting this page! Do you want to have a go yourself?
Pages are best created by people who understand the command they are about.
If you do, take a quick read of CONTRIBUTING.md, which guides you through the process of creating a new page here. Then, just simply send a pull request to this repository - and if you need any assistance, just ask :-)
I am no expert on peoples different implementations of zgrep that they are running.
But as my machine using using GNU grep I can easily read that:
Zgrep invokes
grepon compressed or gzipped files. _All options specified are passed directly to grep_
Together with:
The following grep options are not supported:
--dereference-recursive(-R),--directories(-d),--exclude,--exclude-from,--exclude-dir,--include,--null(-Z),--null-data(-z), and--recursive(-r).
Thus checking the tldr grep
Matches patterns in input text.
Supports simple patterns and regular expressions.
Search for an exact string:
grep search_string path/to/file
Search in case-insensitive mode:
grep -i search_string path/to/file
Search recursively (ignoring non-text files) in current directory for an exact string:
grep -RI search_string .
Use extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`):
grep -E ^regex$ path/to/file
Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
grep -C|B|A 3 search_string path/to/file
Print file name with the corresponding line number for each match:
grep -Hn search_string path/to/file
Use the standard input instead of a file:
cat path/to/file | grep search_string
Invert match for excluding specific strings:
grep -v search_string
It looks like one could probably use the grep page for heavy inspiration of how to write the zgrep one. :)
Reference in the associated PR didn't auto-close this issue (no closes prefix), so since it has been merged I'm closing this issue.
Most helpful comment
I am no expert on peoples different implementations of
zgrepthat they are running.But as my machine using using
GNUgrep I can easily read that:Together with:
Thus checking the
tldr grepIt looks like one could probably use the
greppage for heavy inspiration of how to write thezgrepone. :)