Zcat and zgrep UPDATE 2016-04-26: thanks for article here http://unix.stackexchange.com/questions/77296/is-there-a-tool-that-combines-zcat-and-cat-transparently Forget my lcat function, just use the already provided zgrep and zcat commands. FORMAT:
|
zcat -f -- * # reads all files (normal and gzipped) zgrep -- PATTERN * # looks for pattern in all files (normal and gzipped) zgrep <dashed options> -- PATTERN * # any grep options before the -- |
Examples (all of these work):
|
zcat -f -- messages zcat -f -- messages.0.gz zcat -f -- messages* zcat -f -- * zgrep -- PATTERN messages zgrep -- PATTERN messages.0.gz zgrep -- PATTERN messages* zgrep -- PATTERN * |
Note: dont forgetRead More…