Zcat/Zgrep/Zdiff

本文最后更新于2015年5月10日,已超过 1 年没有更新,如果文章内容失效,还请反馈给我,谢谢!

搜索关键字:

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"
参考链接:

声明: 除非注明,ixyzero.com文章均为原创,转载请以链接形式标明本文地址,谢谢!
https://ixyzero.com/blog/archives/2129.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注