linux\u8ffd\u52a0\u6587\u4ef6<\/strong>\uff0c\u4e00\u822c\u90fd\u53ef\u4ee5\u4f7f\u7528ctrl+c\u6765\u4e2d\u6b62\u7a0b\u5e8f\u8fd0\u884c\u6216\u5219\u9000\u51fa\u7a0b\u5e8f<\/p>\n2\u3001\u7edf\u8ba1\u6587\u4ef6\u4fe1\u606f<\/p>\n
\u2460wc\u7edf\u8ba1\u6587\u4ef6\u5185\u5bb9\u6570\u76ee<\/p>\n
\u547d\u4ee4\uff1awc\uff0cwc=wordcount<\/p>\n
\u4f5c\u7528\uff1a\u7528\u4e8e\u7edf\u8ba1\u6587\u4ef6\u5185\u5bb9\u4fe1\u606f(\u5305\u542b\u884c\u6570\u3001\u5355\u8bcd\u6570\u3001\u5b57\u8282\u6570)<\/p>\n
\u53e5\u578b\uff1a#wc[\u53c2\u6570\u9009\u9879]\u6587\u4ef6\u540d<\/p>\n
\u5e38\u89c1\u53c2\u6570\uff1a<\/p>\n
-l\uff1a\u8868\u793alines\uff0c\u884c\u6570(\u4ee5\u56de\u8f66\/\u6362\u884c\u7b26\u4e3a\u6807\u51c6)<\/p>\n
-w\uff1a\u8868\u793awords\uff0c\u8bcd\u7ec4\u6570\u6839\u636e\u7a7a\u683c\u6765\u5224\u5b9a\u8bcd\u7ec4\u6570\u76ee<\/p>\n
-c\uff1a\u8868\u793abytes\uff0c\u5b57\u8282\u6570(\u7a7a\u683c\uff0c\u56de\u8f66\uff0c\u6362\u884c)<\/p>\n
\u7528\u6cd5\u4e00\uff1awc-lwc\u6587\u4ef6\u540d<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#wc-lwc\/var\/log\/boot.log<\/p>\n
\u542b\u610f\uff1a\u7edf\u8ba1\/var\/log\/boot.log\u6587\u4ef6\u7684\u884c\u6570linux\u624b\u673a\uff0c\u8bcd\u7ec4\u6570\uff0c\u5b57\u8282\u6570<\/p>\n
\u6ce8\u610f\uff1awc\u547d\u4ee4\u9009\u9879\u53ef\u4ee5\u6df7\u5728\u4e00\u8d77\u642d\u914d\u4f7f\u7528\uff0c\u4f46\u9009\u9879\u7684\u6b21\u5e8f\u4e0d\u5f71\u54cd\u8f93\u51fa\u7ed3\u679c\uff0c\u7b2c\u4e00\u4e2a\u662f\u884c\u6570\uff0c\u7b2c\u4e8c\u4e2a\u662f\u8bcd\u7ec4\u6570\uff0c\u7b2c\u4e09\u4e2a\u6570\u5b57\u8282\u6570\u3002<\/p>\n
\u2461du\u7edf\u8ba1\u6587\u4ef6\u5927\u5c0f<\/p>\n
\u547d\u4ee4\uff1adu<\/p>\n
\u4f5c\u7528\uff1a\u67e5\u770b\u6587\u4ef6\u6216\u76ee\u5f55(\u4f1a\u9012\u5f52\u663e\u793a\u5b50\u76ee\u5f55)\u5360\u7528c\u76d8\u7a7a\u95f4\u5927\u5c0f<\/p>\n
\u53e5\u578b\uff1a#du[\u53c2\u6570\u9009\u9879]\u6587\u4ef6\u540d\u6216\u76ee\u5f55\u540d<\/p>\n
\u5e38\u89c1\u53c2\u6570\uff1a<\/p>\n
-s\uff1asummaries\uff0c\u53ea\u663e\u793a\u6c47\u603b\u7684\u5927\u5c0f\uff0c\u7edf\u8ba1\u6587\u4ef6\u5939\u7684\u5927\u5c0f<\/p>\n
-h\uff1a\u8868\u793a\u4ee5\u9ad8\u53ef\u8bfb\u6027\u7684\u65b9\u5f0f\u8fdb\u884c\u663e\u793a\uff0c\u5047\u82e5\u4e0d\u5199-h\uff0c\u9ed8\u8ba4\u4ee5KB\u7684\u65b9\u5f0f\u663e\u793a\u6587\u4ef6\u5927\u5c0f<\/p>\n
\u7528\u6cd5\u4e00\uff1adu\u6587\u4ef6\u540d<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#du\/var\/log\/boot.log<\/p>\n
\u6db5\u4e49\uff1a\u7edf\u8ba1\/var\/log\/boot.log\u6587\u4ef6\u7684\u5927\u5c0f<\/p>\n
\u7528\u6cd5\u4e8c\uff1adu-h\u6587\u4ef6\u540d<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#du-h\/var\/log\/boot.log<\/p>\n
\u6db5\u4e49\uff1a\u7edf\u8ba1\/var\/log\/boot.log\u6587\u4ef6\u7684\u5927\u5c0f,\u4ee5\u9ad8\u53ef\u8bfb\u6027\u663e\u793a<\/p>\n
<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a\u7edf\u8ba1\/var\/log\u76ee\u5f55\u5927\u5c0f<\/p>\n
\u7528\u6cd5\u4e09\uff1adu\u76ee\u5f55\u540d<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#du\/var\/log\/<\/p>\n
\u542b\u610f\uff1a\u7edf\u8ba1\/var\/log\/\u76ee\u5f55\u7684\u5927\u5c0f\uff0c\u5305\u542b\u76ee\u5f55\u4e0b\u6bcf\u4e00\u4e2a\u5355\u72ec\u6587\u4ef6\u7684\u5927\u5c0f<\/p>\n
\u7528\u6cd5\u56db\uff1adu-s\u76ee\u5f55\u540d<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#du-s\/var\/log\/<\/p>\n
\u542b\u610f\uff1a\u7edf\u8ba1\/var\/log\/boot.log\u6587\u4ef6\u7684\u5927\u5c0f,\u6c47\u603b\u53ea\u663e\u793a\u76ee\u5f55\u5927\u5c0f<\/p>\n
\u7528\u6cd5\u4e94\uff1adu-sh\u76ee\u5f55\u540d<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#du-sh\/var\/log\/<\/p>\n
\u542b\u610f\uff1a\u7edf\u8ba1\/var\/log\/boot.log\u6587\u4ef6\u7684\u5927\u5c0f,\u6c47\u603b\u53ea\u663e\u793a\u76ee\u5f55\u5927\u5c0f,\u5e76\u91c7\u7528\u9ad8\u53ef\u8bfb\u6027<\/p>\n
3\u3001\u6587\u672c\u5904\u7406<\/p>\n
\u2460find\u6587\u4ef6\u67e5\u627e(\u91cd\u70b9)<\/p>\n
\u547d\u4ee4\uff1afind<\/p>\n
\u4f5c\u7528\uff1a\u7528\u4e8e\u67e5\u627e\u6587\u6863(\u5176\u9009\u9879\u670955\u4e2a\u4e4b\u591a)<\/p>\n
\u53e5\u578b\uff1a#find\u8def\u5f84\u8303\u56f4\u9009\u98791\u9009\u98791\u7684\u503c[\u9009\u98792\u9009\u98792\u7684\u503c\u2026]<\/p>\n
\u5e38\u7528\u53c2\u6570\uff1a<\/p>\n
-name\uff1a\u6839\u636e\u6587\u6863\u540d\u79f0\u8fdb\u884c\u641c\u7d22(\u652f\u6301\u6a21\u7cca\u641c\u7d22)<\/p>\n
*\uff1a\u952e\u503c\u7ea2\u65d7linux\u4e0b\u8f7d\uff0c\u5339\u914d\u4efb\u610f\u4e2a\u4efb\u610f\u5b57\u7b26<\/p>\n
-type\uff1a\u6839\u636e\u6587\u6863\u7684\u7c7b\u578b\u8fdb\u884c\u641c\u7d22<\/p>\n
\u6587\u6863\u7c7b\u578b\u7684\u503c\uff1a\"-\"\u8868\u793a\u6587\u4ef6\uff08\u5728\u4f7f\u7528find\u7684\u65f6\u4faf\u987b\u8981\u7528f\u6765\u66ff\u6362\uff09\uff0c\"d\"\u8868\u793a\u6587\u4ef6\u5939<\/p>\n
\u7528\u6cd5\u4e00\uff1afind\u8def\u5f84\u8303\u56f4\u9009\u98791\u9009\u98791\u7684\u503c\u9009\u98792\u9009\u98792\u7684\u503c<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#find\/var\/-nameboot.log-typef<\/p>\n
\u542b\u610f\uff1a\u5728\/var\/\u76ee\u5f55\u4e0b\uff0c\u67e5\u627e\u540d\u79f0\u7b49\u4e8eboot.log\uff0c\u7c7b\u578b\u662f\u6587\u4ef6\u7684\u6587\u6863<\/p>\n
\u7528\u6cd5\u4e8c\uff1afind\u8def\u5f84\u8303\u56f4\u9009\u98791\u9009\u98791\u7684\u503c\u4f7f\u7528\u8f6c\u4e49\u9009\u98792\u9009\u98792\u7684\u503c<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#find\/var\/log-name\"*.log\"-typef<\/p>\n
\u542b\u610f\uff1a\u5728\/var\/log\u76ee\u5f55\u4e0b\uff0c\u67e5\u627e\u6240\u6709.log\u7ed3\u5c3e\uff0c\u7c7b\u578b\u662f\u6587\u4ef6\u7684\u6587\u6863\uff0c*.log\u987b\u8981\u7528\u5192\u53f7\u9020\u6210\u6765\u3002<\/p>\n
\u7528\u6cd5\u4e00\uff1afind\u8def\u5f84\u8303\u56f4\u9009\u98791\u9009\u98791\u7684\u503c<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#find\/var\/log-typed<\/p>\n
\u542b\u610f\uff1a\u5728\/var\/log\u76ee\u5f55\u4e0b\uff0c\u67e5\u627e\u6240\u6709\u6587\u4ef6\u5939<\/p>\n
\u2461grep\u641c\u7d22\u6587\u4ef6\u5185\u5bb9(\u91cd\u8981)<\/p>\n
\u547d\u4ee4\uff1agrep<\/p>\n
\u4f5c\u7528\uff1a\u5728\u6587\u4ef6\u4e2d\u76f4\u63a5\u627e\u5230\u5305\u542b\u6307\u5b9a\u4fe1\u606f\u7684\u8fd9\u4e9b\u884c\uff0c\u5e76\u628a\u8fd9\u79cd\u4fe1\u606f\u663e\u793a\u4e0b\u6765<\/p>\n
\u53e5\u578b\uff1a#grep\u8981\u67e5\u627e\u7684\u5185\u5bb9\u6587\u4ef6\u540d<\/p>\n
\u7528\u6cd5\u4e00\uff1agrep\u67e5\u627e\u7684\u5185\u5bb9\u6587\u4ef6\u540d<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#grepnetworkboot.log<\/p>\n
\u542b\u610f\uff1a\u5728boot.log\u6587\u4ef6\u4e2d\uff0c\u67e5\u627e\u5305\u542bnetwork\u7684\u884c<\/p>\n
\u7528\u6cd5\u4e8c\uff1agrep\u67e5\u627e\u7684\u5185\u5bb9\u591a\u4e2a\u6587\u4ef6<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#grepnetwork\/var\/log\/*<\/p>\n
\u542b\u610f\uff1a\u5728\/var\/log\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u4e2d\uff0c\u67e5\u627e\u5305\u542bnetwork\u7684\u884c<\/p>\n
\u2462\u8f93\u51fa\u91cd\u5b9a\u5411<\/p>\n
\u573a\u666f\uff1a\u901a\u5e38\u547d\u4ee4\u7684\u8f93\u51fa\u5c31\u4f1a\u663e\u793a\u5728\u7ec8\u7aef\u4e2d\uff0c\u6709\u4e9b\u65f6\u4faf\u987b\u8981\u5c06\u4e00\u4e9b\u547d\u4ee4\u7684\u6267\u884c\u7ed3\u679c\u60f3\u8981\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\u8fdb\u884c\u540e\u7eed\u7684\u5256\u6790\/\u7edf\u8ba1\uff0c\u5219\u8fd9\u65f6\u4faf\u987b\u8981\u4f7f\u7528\u5230\u7684\u8f93\u51fa\u91cd\u5b9a\u5411\u6280\u672f\u3002<\/p>\n
>\uff1a\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411:\u8986\u76d6\u8f93\u51fa\uff0c\u4f1a\u8986\u76d6\u6389\u539f\u672c\u7684\u6587\u4ef6\u5185\u5bb9<\/p>\n
>>\uff1a\u8ffd\u52a0\u91cd\u5b9a\u5411:\u8ffd\u52a0\u8f93\u51fa\uff0c\u4e0d\u4f1a\u8986\u76d6\u539f\u59cb\u6587\u4ef6\u5185\u5bb9\uff0c\u4f1a\u5728\u539f\u59cb\u5185\u5bb9\u672b\u5c3e\u7ee7\u7eed\u6dfb\u52a0<\/p>\n
\u53e5\u578b\uff1a#\u6709\u8f93\u51fa\u7684\u547d\u4ee4\u91cd\u5b9a\u5411\u7b26\u53f7\u6587\u4ef6\u540d<\/p>\n
\u7528\u6cd5\u4e00\uff1a\u4f7f\u7528>\u8fdb\u884c\u8986\u76d6\u8f93\u51fa<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#11>llroot.txt<\/p>\n
\u542b\u610f\uff1a\u5c06ll\u547d\u4ee4\u8f93\u51fa\u7684\u5185\u5bb9\uff0c\u5199\u5165\u5230llroot.txt\u6587\u4ef6\u4e2d\uff0c\u5047\u5982llroot.txt\u6587\u4ef6\u4e2d\u6709\u5176\u4ed6\u5185\u5bb9\uff0c\u5219\u5148\u6e05\u7a7a\uff0c\u5728\u5199\u5165<\/p>\n
\u6ce8\u610f\uff1a\u6587\u4ef6\u8def\u5f84\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u662f\u4e0d\u5b58\u5728\u7684\u6587\u4ef6\uff0c\u6bd4\u5982llroot.txt\u53ef\u4ee5\u4e0d\u5b58\u5728\uff0c\u6267\u884c\u547d\u4ee4\u65f6\u4f1a\u624b\u52a8\u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6<\/p>\n
\u7528\u6cd5\u4e8c\uff1a\u4f7f\u7528>>\u8fdb\u884c\u8ffd\u52a0\u8f93\u51fa<\/p>\n
\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n
#11>>llroot.txt<\/p>\n
\u542b\u610f\uff1a\u5c06ll\u547d\u4ee4\u8f93\u51fa\u7684\u5185\u5bb9\uff0c\u8ffd\u52a0\u5199\u5165\u5230llroot.txt\u6587\u4ef6\u4e2d<\/p>\n
\u6ce8\u610f\uff1a\u6587\u4ef6\u8def\u5f84\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u662f\u4e0d\u5b58\u5728\u7684\u6587\u4ef6\uff0c\u6bd4\u5982llroot.txt\u53ef\u4ee5\u4e0d\u5b58\u5728\uff0c\u6267\u884c\u547d\u4ee4\u65f6\u4f1a\u624b\u52a8\u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6<\/p>\n","protected":false},"excerpt":{"rendered":"
\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\u65f6\uff0c\u4e0d\u8bba\u6587\u4ef6\u5185\u5bb9\u6709\u591a\u5c11\uff0c\u90fd\u4f1a\u4e00\u6b21\u6027\u663e\u793a\u3002\u6d41\u7a0b\uff1amore\u5728\u8bfb\u53d6\u6587\u4ef6\u65f6\uff0c\u9ed8\u8ba4\u5df2\u7ecf\u52a0\u8f7d\u6587\u4ef6\u7684\u5168\u90e8\u5185\u5bb9\u3002log\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a\u524d10\u884clog\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u4e3a\u6700\u540e10\u884clog\u6587\u4ef6\u4e2d\uff0c\u67e5\u627e\u5305\u542bnetwork\u7684\u884c\u542b\u4e49\uff1a\u5728\/var\/log\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u4e2d\uff0c\u67e5\u627e\u5305\u542bnetwork\u7684\u884ctxt\u53ef\u4ee5\u4e0d\u5b58\u5728\uff0c\u6267\u884c\u547d\u4ee4\u65f6\u4f1a\u81ea\u52a8\u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6\u542b\u4e49\uff1a\u5c06ll\u547d\u4ee4\u8f93\u51fa\u7684\u5185\u5bb9\uff0c\u8ffd\u52a0\u5199\u5165\u5230llroot.txt\u53ef\u4ee5\u4e0d\u5b58\u5728\uff0c\u6267\u884c\u547d\u4ee4\u65f6\u4f1a\u81ea\u52a8\u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6<\/p>\n","protected":false},"author":1,"featured_media":281800,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-281799","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/281799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=281799"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/281799\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/281800"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=281799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=281799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=281799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}