{"id":7033,"date":"2020-04-29T18:49:45","date_gmt":"2020-04-29T10:49:45","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=7033"},"modified":"2020-04-29T18:49:46","modified_gmt":"2020-04-29T10:49:46","slug":"zegrep","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/zegrep","title":{"rendered":"zegrep\u547d\u4ee4 – \u6587\u4ef6\u5b57\u7b26\u4e32\u8fc7\u6ee4"},"content":{"rendered":"\n

zegrep\u547d\u4ee4\u662f\u4e00\u4e2a\u6587\u4ef6\u5b57\u7b26\u4e32\u8fc7\u6ee4\u5de5\u5177\uff0c\u53ef\u4ee5\u4f7f\u7528zegrep\u5728\u538b\u7f29\u6587\u4ef6\u4e2d\u591a\u6b21\u641c\u7d22\u76f8\u5bf9\u5e94\u7684\u6587\u4ef6\u540d\u4e0e\u5185\u5bb9\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>zegrep [\u53c2\u6570] [\u6587\u4ef6\u8def\u5f84]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-n<\/td>\u641c\u7d22\u663e\u793a\u884c<\/td><\/tr>
-l<\/td>\u5217\u51fa\u5305\u542b\u591a\u4e2a\u6a21\u5f0f\u7684\u90a3\u4e9b\u538b\u7f29\u6587\u4ef6\u7684\u6587\u4ef6\u540d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u4f7f\u7528zegrep\u8fc7\u6ee4linuxprobe.txt\u4e2dlinuxcool\u5b57\u7b26\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# zegrep \"linuxcool\" linuxprobe.txt<\/pre>\n\n\n\n

\u4f7f\u7528zegrep\u641c\u7d22\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u591a\u91cd\u6a21\u5f0f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# zegrep 'shah|root|apache' linuxprobe.gz<\/pre>\n\n\n\n

\u4f7f\u7528\u538b\u7f29\u6587\u4ef6\u4e2d\u7684-n\u9009\u9879\u5728\u6587\u4ef6\u4e2d\u641c\u7d22\u591a\u4e2a\u6a21\u5f0f\u4ee5\u53ca\u76f8\u5173\u7684\u884c\u53f7\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# zegrep -n 'shah|root|apache' linuxprobe.gz<\/pre>\n\n\n\n

\u4f7f\u7528-l\u9009\u9879\u5217\u51fa\u5305\u542b\u591a\u4e2a\u6a21\u5f0f\u7684\u90a3\u4e9b\u538b\u7f29\u6587\u4ef6\u7684\u6587\u4ef6\u540d\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# zegrep -l 'shah|root|apache' *.gz<\/pre>\n","protected":false},"excerpt":{"rendered":"

zegrep\u547d\u4ee4\u662f\u4e00\u4e2a\u6587\u4ef6\u5b57\u7b26\u4e32\u8fc7\u6ee4\u5de5\u5177\uff0c\u53ef\u4ee5\u4f7f\u7528zegrep\u5728\u538b\u7f29\u6587\u4ef6\u4e2d\u591a\u6b21\u641c\u7d22\u76f8\u5bf9\u5e94\u7684\u6587\u4ef6\u540d\u4e0e\u5185\u5bb9\u3002 \u8bed\u6cd5 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7033"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=7033"}],"version-history":[{"count":4,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7033\/revisions"}],"predecessor-version":[{"id":7146,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7033\/revisions\/7146"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=7033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=7033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=7033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}