搜索关键字:
zgrep zcat
参考内容:
The old way…
$ gzip -d data.txt.gz $ cat data.txt $ less data.txt $ more data.txt
The new way…
$ zcat data.txt.gz $ zless data.txt.gz $ zmore data.txt.gz
Compare compressed files. The syntax is:
$ zdiff file1.gz file2.gz $ zcmp file1.gz file2.gz
==
$ zegrep -w '^word1|word2' file.gz $ zgrep 'wordToSearch' file.gz $ zgrep '1.2.3.4' access_log_1.gz $ find /path/to/dir/ -iname '*.gz' -print0 | xargs -0 -I {} zgrep "pattern" {} $ zcat ABC/myzippedfile1.txt.gz | grep "pattern match" $ zgrep -R --include=*.gz -H "pattern match" . $ find . -name "*.gz" -exec zgrep "pattern match" \{\} \; $ find . -name "*.gz" -exec zcat "{}" + | grep "pattern match" $ zcat -r /some/dir/here | grep "pattern match"
参考链接:
- http://www.cyberciti.biz/tips/decompress-and-expand-text-files.html
- http://www.thegeekstuff.com/2009/05/zcat-zless-zgrep-zdiff-zcmp-zmore-gzip-file-operations-on-the-compressed-files/
- http://blog.lysender.com/2012/01/log-parsing-grep-cat-zgrep-and-zcat/
- http://stackoverflow.com/questions/1253816/find-string-inside-a-gzipped-file-in-a-folder
- =
- http://unix.stackexchange.com/questions/131918/is-it-possible-to-make-zcat-output-text-even-if-its-uncompressed
- =
- dynamic zcat and grep
- =
- http://stackoverflow.com/questions/9081/grep-a-file-but-show-several-surrounding-lines