\u5982\u4f55\u5c06\u7f51\u9875\u6253\u5305\u4e3aexe\u6267\u884c<\/a>t<\/p>\n“`<\/p>\n
\u8868\u793a\u5728file.txt\u6587\u4ef6\u4e2d\u641c\u7d22\u4e0d\u5305\u542b”hello”\u5b57\u7b26\u4e32\u7684\u884c\uff0c\u5e76\u8f93\u51fa\u5339\u914d\u7ed3\u679c\u3002<\/p>\n
3. \u641c\u7d22\u5ffd\u7565\u5927\u5c0f\u5199<\/p>\n
\u5982\u679c\u8981\u641c\u7d22\u5ffd\u7565\u5927\u5c0f\u5199\uff0c\u53ef\u4ee5\u4f7f\u7528grep\u7684-i\u9009\u9879\uff0c\u4f8b\u5982\uff1a<\/p>\n
“`<\/p>\n
grep -i “hello” file.txt<\/p>\n
“`<\/p>\n
\u8868\u793a\u5728file.txt\u6587\u4ef6\u4e2d\u641c\u7d22\u5305\u542b”hello”\u5b57\u7b26\u4e32\u7684\u884c\uff08\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff09\uff0c\u5e76\u8f93\u51fa\u5339\u914d\u7ed3\u679c\u3002<\/p>\n
4. \u641c\u7d22\u663e\u793a\u5339\u914d\u884c\u7684\u4e0a\u4e0b\u6587<\/p>\n
\u5982\u679c\u8981\u641c\u7d22\u663e\u793a\u5339\u914d\u884c\u7684\u4e0a\u4e0b\u6587\uff0c\u53ef\u4ee5\u4f7f\u7528grep\u7684-A\u3001-B\u3001-C\u9009\u9879\uff0c\u4f8b\u5982\uff1a<\/p>\n
“`<\/p>\n
grep -A 2 -B 2 “hello” file.txt<\/p>\n
“`<\/p>\n
\u8868\u793a\u5728file.txt\u6587\u4ef6\u4e2d\u641c\u7d22\u5305\u542b”hello”\u5b57\u7b26\u4e32\u7684\u884c\uff0c\u5e76\u663e\u793a\u5339\u914d\u884c\u7684\u524d\u4e24\u884c\u548c\u540e\u4e24\u884c\uff08\u51715\u884c\uff09\u3002<\/p>\n
\u603b\u7ed3<\/p>\n
\u672c\u6587\u4ecb\u7ecd\u4e86Linux\u7cfb\u7edf\u4e2d\u6587\u4ef6\u5185\u641c\u7d22\u7684\u539f\u7406\u53ca\u5e38\u7528\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5e76\u4ecb\u7ecd\u4e86\u4e00\u4e9b\u4f7f\u7528\u6280\u5de7\uff0c\u5e0c\u671b\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u52a0\u9ad8\u6548\u5730\u8fdb\u884c\u6587\u4ef6\u641c\u7d22\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6587\u4ef6\u641c\u7d22\u662f\u975e\u5e38\u5e38\u89c1\u7684\u64cd\u4f5c\uff0c\u800c\u6587\u4ef6\u641c\u7d22\u7684\u65b9\u5f0f\u4e5f\u662f\u591a\u79cd\u591a\u6837\u3002\u672c\u6587\u5c06\u4e3a\u60a8\u4ecb\u7ecdLinux\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u5185\u641c\u7d22\u539f\u7406\u53ca\u8be6\u7ec6\u4ecb\u7ecd\u3002\u4e00\u3001\u6587\u4ef6\u5185\u641c\u7d22\u539f\u7406\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6587\u4ef6\u5185\u641c\u7d22\u7684\u539f\u7406\u662f\u5229\u7528\u547d\u4ee4<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[9871,11877,1620,330,12],"topic":[],"class_list":["post-6584","post","type-post","status-publish","format-standard","hentry","category-zhuomianruanjian","tag-exe","tag-vueexe","tag-1620","tag-330","tag-12"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/6584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=6584"}],"version-history":[{"count":0,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/6584\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=6584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=6584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=6584"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=6584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}