{"id":185,"date":"2010-07-20T17:27:20","date_gmt":"2010-07-20T15:27:20","guid":{"rendered":"http:\/\/astronomy.lamost.org\/blog\/?p=185"},"modified":"2010-07-20T17:34:01","modified_gmt":"2010-07-20T15:34:01","slug":"linux%e9%87%8c%e6%80%8e%e6%a0%b7%e6%9f%a5%e6%89%be%e6%96%87%e4%bb%b6%e5%86%85%e5%ae%b9","status":"publish","type":"post","link":"http:\/\/astronomy.lamost.org\/blog\/?p=185","title":{"rendered":"\u505a\u4e2a\u9ad8\u6548\u7684\u6c11\u5de5\u4e4b\u7406\u6e05\u7a0b\u5e8f\u7ed3\u6784"},"content":{"rendered":"<p>\u6709\u4e00\u4e2a\u7a0b\u5e8f\u6709\u592a\u591a\u5b50\u7a0b\u5e8f\u5206\u522b\u5199\u5728\u5355\u72ec\u7684\u6587\u4ef6\u5185\u3002\u60f3\u67e5\u627e\u67d0\u4e2a\u5b50\u7a0b\u5e8f\u88ab\u8c01\u8c03\u7528\uff0c\u8981\u662f\u5355\u4e2a\u6253\u5f00\u6bcf\u4e2a\u6587\u4ef6\u641c\u7d22\u5c31\u592a\u571f\u4e86\uff01\uff01\uff01<br \/>\n\u7528grep \u5c31\u5feb\u591a\u4e86\uff0cgrep\u7528\u6cd5\u300b<\/p>\n<p>http:\/\/hi.baidu.com\/xie_jin\/blog\/item\/1bab534c7e3136fad72afcf2.html<\/p>\n<p>Linux\u67e5\u627e\u6587\u4ef6\u5185\u5bb9\u7684\u5e38\u7528\u547d\u4ee4\u65b9\u6cd5\u3002<\/p>\n<p>\u4ece\u6587\u4ef6\u5185\u5bb9\u67e5\u627e\u5339\u914d\u6307\u5b9a\u5b57\u7b26\u4e32\u7684\u884c\uff1a<br \/>\n$ grep &#8220;\u88ab\u67e5\u627e\u7684\u5b57\u7b26\u4e32&#8221; \u6587\u4ef6\u540d<\/p>\n<p>\u4ece\u6587\u4ef6\u5185\u5bb9\u67e5\u627e\u4e0e\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u7684\u884c\uff1a<br \/>\n$ grep \u2013e \u201c\u6b63\u5219\u8868\u8fbe\u5f0f\u201d \u6587\u4ef6\u540d<\/p>\n<p>\u67e5\u627e\u65f6\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff1a<br \/>\n$ grep \u2013i &#8220;\u88ab\u67e5\u627e\u7684\u5b57\u7b26\u4e32&#8221; \u6587\u4ef6\u540d<\/p>\n<p>\u67e5\u627e\u5339\u914d\u7684\u884c\u6570\uff1a<br \/>\n$ grep -c &#8220;\u88ab\u67e5\u627e\u7684\u5b57\u7b26\u4e32&#8221; \u6587\u4ef6\u540d<\/p>\n<p>\u4ece\u6587\u4ef6\u5185\u5bb9\u67e5\u627e\u4e0d\u5339\u914d\u6307\u5b9a\u5b57\u7b26\u4e32\u7684\u884c\uff1a<br \/>\n$ grep \u2013v &#8220;\u88ab\u67e5\u627e\u7684\u5b57\u7b26\u4e32&#8221; \u6587\u4ef6\u540d<\/p>\n<p>\u4ece\u6839\u76ee\u5f55\u5f00\u59cb\u67e5\u627e\u6240\u6709\u6269\u5c55\u540d\u4e3a.log\u7684\u6587\u672c\u6587\u4ef6\uff0c\u5e76\u627e\u51fa\u5305\u542b\u201dERROR\u201d\u7684\u884c<br \/>\nfind \/ -type f -name &#8220;*.log&#8221; | xargs grep &#8220;ERROR&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u4e00\u4e2a\u7a0b\u5e8f\u6709\u592a\u591a\u5b50\u7a0b\u5e8f\u5206\u522b\u5199\u5728\u5355\u72ec\u7684\u6587\u4ef6\u5185\u3002\u60f3\u67e5\u627e\u67d0\u4e2a\u5b50\u7a0b\u5e8f\u88ab\u8c01\u8c03\u7528\uff0c\u8981\u662f\u5355\u4e2a\u6253\u5f00\u6bcf\u4e2a\u6587\u4ef6\u641c\u7d22\u5c31\u592a\u571f\u4e86\uff01\uff01\uff01 &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,15],"tags":[],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-1","category-15"],"_links":{"self":[{"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=185"}],"version-history":[{"count":4,"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/185\/revisions"}],"predecessor-version":[{"id":188,"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/185\/revisions\/188"}],"wp:attachment":[{"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/astronomy.lamost.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}