{"id":62076,"date":"2025-04-29T08:37:05","date_gmt":"2025-04-29T00:37:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/62076\/"},"modified":"2025-04-29T08:37:05","modified_gmt":"2025-04-29T00:37:05","slug":"%e8%b6%85%e5%ae%9e%e7%94%a8%e7%9a%84-linux-%e9%ab%98%e7%ba%a7%e5%91%bd%e4%bb%a4%ef%bc%8c%e7%a8%8b%e5%ba%8f%e5%91%98%e4%b8%80%e5%ae%9a%e8%a6%81%e6%87%82%ef%bc%81-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/62076\/","title":{"rendered":"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01"},"content":{"rendered":"<p> <\/p>\n<p><span style=\"font-size: 20px\"><strong>\u524d\u8a00<\/strong><\/span><\/p>\n<p> <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5728\u8fd0\u7ef4\u7684\u5751\u91cc\u6478\u722c\u6eda\u6253\u597d\u51e0\u5e74\u4e86\uff0c\u6211\u8fd8\u8bb0\u5f97\u6211\u521a\u5f00\u59cb\u7684\u65f6\u5019\uff0c\u6211\u53ea\u4f1a\u4f7f\u7528\u4e00\u4e9b\u7b80\u5355\u7684\u547d\u4ee4\uff0c\u5199\u811a\u672c\u7684\u65f6\u5019\uff0c\u4e5f\u662f\u8981\u591a\u7b80\u5355\u6709\u591a\u7b80\u5355\uff0c\u6240\u4ee5\u6709\u65f6\u5019\u5199\u51fa\u6765\u7684\u811a\u672c\u53c8\u957f\u53c8\u81ed\u3002<br \/><\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/7cd534006d2019c8d4872aa3d85195e7-0.jpg\" class=\"aligncenter\" title=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe\" alt=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe\" \/><\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u50cf\u4e00\u4e9b\u9ad8\u7ea7\u70b9\u7684\u547d\u4ee4\uff0c\u6bd4\u5982\u8bf4 Xargs \u547d\u4ee4\u3001\u7ba1\u9053\u547d\u4ee4\u3001\u81ea\u52a8\u5e94\u7b54\u547d\u4ee4\u7b49\uff0c\u5982\u679c\u5f53\u521d\u6211\u8981\u662f\u77e5\u9053\uff0c\u90a3\u6211\u4e5f\u53ef\u80fd\u5199\u51fa\u7b80\u6d01\u9ad8\u6548\u7684\u811a\u672c\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u4e0d\u7ba1\u51fa\u4e8e\u4efb\u4f55\u539f\u56e0\uff0c\u6211\u90fd\u60f3\u5bf9\u4e00\u4e9b Linux \u4f7f\u7528\u7684\u9ad8\u7ea7\u547d\u4ee4\u8fdb\u884c\u7528\u6cd5\u8bf4\u660e\uff0c\u5229\u4eba\u5229\u5df1\uff0c\u4ee5\u540e\u4e0d\u8bb0\u5f97\u7684\u8bdd\uff0c\u6211\u4e5f\u53ef\u4ee5\u56de\u5934\u7ffb\u6765\u770b\u770b\u3002<\/span><\/p>\n<p><strong><span style=\"font-size: 20px\">\u4e00\u3001\u5b9e\u7528\u7684 xargs \u547d\u4ee4<\/span><\/strong><\/p>\n<p> <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5728\u5e73\u65f6\u7684\u4f7f\u7528\u4e2d\uff0c\u6211\u8ba4\u4e3a xargs \u8fd9\u4e2a\u547d\u4ee4\u8fd8\u662f\u8f83\u4e3a\u91cd\u8981\u548c\u65b9\u4fbf\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\uff0c\u5c06\u547d\u4ee4\u8f93\u51fa\u7684\u7ed3\u679c\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u547d\u4ee4\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u6bd4\u5982\u8bf4\u6211\u4eec\u60f3\u627e\u51fa\u67d0\u4e2a\u8def\u5f84\u4e0b\u4ee5 .conf \u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u5e76\u5c06\u8fd9\u4e9b\u6587\u4ef6\u8fdb\u884c\u5206\u7c7b\uff0c\u90a3\u4e48\u666e\u901a\u7684\u505a\u6cd5\u5c31\u662f\u5148\u5c06\u4ee5 .conf \u7ed3\u5c3e\u7684\u6587\u4ef6\u5148\u627e\u51fa\u6765\uff0c\u7136\u540e\u8f93\u51fa\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u63a5\u7740 cat \u8fd9\u4e2a\u6587\u4ef6\uff0c\u5e76\u4f7f\u7528 file \u6587\u4ef6\u5206\u7c7b\u547d\u4ee4\u53bb\u5bf9\u8f93\u51fa\u7684\u6587\u4ef6\u8fdb\u884c\u5206\u7c7b\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u8fd9\u4e2a\u666e\u901a\u7684\u65b9\u6cd5\u8fd8\u7684\u786e\u662f\u7565\u663e\u9ebb\u70e6\uff0c\u90a3\u4e48\u8fd9\u4e2a\u65f6\u5019 xargs \u547d\u4ee4\u5c31\u6d3e\u4e0a\u7528\u573a\u4e86\u3002<br \/>\u4f8b1\uff1a\u627e\u51fa \/ \u76ee\u5f55\u4e0b\u4ee5 .conf \u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u5e76\u8fdb\u884c\u6587\u4ef6\u5206\u7c7b<br \/>\u547d\u4ee4\uff1a<\/span><\/p>\n<pre>find&nbsp;\/&nbsp;-name&nbsp;*.conf&nbsp;-type&nbsp;f&nbsp;\n-print&nbsp;|&nbsp;xargs&nbsp;file<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b\u6240\u793a\uff1a<\/span><\/p>\n<p style=\"margin-bottom: 0em;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/7cd534006d2019c8d4872aa3d85195e7-1.jpg\" class=\"aligncenter\" title=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe1\" alt=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe1\" \/><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">xargs \u540e\u9762\u4e0d\u4ec5\u4ec5\u53ef\u4ee5\u52a0\u6587\u4ef6\u5206\u7c7b\u7684\u547d\u4ee4\uff0c\u4f60\u8fd8\u53ef\u4ee5\u52a0\u5176\u4ed6\u7684\u5f88\u591a\u547d\u4ee4\uff0c\u6bd4\u5982\u8bf4\u5b9e\u5728\u4e00\u70b9\u7684tar\u547d\u4ee4\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528find\u547d\u4ee4\u914d\u5408tar\u547d\u4ee4\uff0c\u5c06\u6307\u5b9a\u8def\u5f84\u7684\u7279\u6b8a\u6587\u4ef6\u4f7f\u7528find\u547d\u4ee4\u627e\u51fa\u6765\uff0c\u7136\u540e\u914d\u5408tar\u547d\u4ee4\u5c06\u627e\u51fa\u7684\u6587\u4ef6\u76f4\u63a5\u6253\u5305\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/span><\/p>\n<pre>find&nbsp;\/&nbsp;-name&nbsp;*.conf&nbsp;-type&nbsp;f&nbsp;\n-print&nbsp;|&nbsp;xargs&nbsp;tar&nbsp;cjf&nbsp;test.tar.gz<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"font-size: 20px\"><strong>\u4e8c\u3001\u547d\u4ee4\u6216\u811a\u672c\u540e\u53f0\u8fd0\u884c<\/strong><\/span><\/p>\n<p> <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u6709\u65f6\u5019\u6211\u4eec\u8fdb\u884c\u4e00\u4e9b\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u4e0d\u5e0c\u671b\u6211\u4eec\u7684\u64cd\u4f5c\u5728\u7ec8\u7aef\u4f1a\u8bdd\u65ad\u4e86\u4e4b\u540e\u5c31\u8ddf\u7740\u65ad\u4e86\uff0c\u7279\u522b\u662f\u4e00\u4e9b\u6570\u636e\u5e93\u5bfc\u5165\u5bfc\u51fa\u64cd\u4f5c\uff0c\u5982\u679c\u6d89\u53ca\u5230\u5927\u6570\u636e\u91cf\u7684\u64cd\u4f5c\uff0c\u6211\u4eec\u4e0d\u53ef\u80fd\u4fdd\u8bc1\u6211\u4eec\u7684\u7f51\u7edc\u5728\u6211\u4eec\u7684\u64cd\u4f5c\u671f\u95f4\u4e0d\u51fa\u95ee\u9898\uff0c\u6240\u4ee5\u540e\u53f0\u8fd0\u884c\u811a\u672c\u6216\u8005\u547d\u4ee4\u5bf9\u6211\u4eec\u6765\u8bf4\u662f\u4e00\u5927\u4fdd\u969c\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u6bd4\u5982\u8bf4\u6211\u4eec\u60f3\u628a\u6570\u636e\u5e93\u7684\u5bfc\u51fa\u64cd\u4f5c\u540e\u53f0\u8fd0\u884c\uff0c\u5e76\u4e14\u5c06\u547d\u4ee4\u7684\u64cd\u4f5c\u8f93\u51fa\u8bb0\u5f55\u5230\u6587\u4ef6\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u8fd9\u4e48\u505a\uff1a\uff08\u53cd\u659c\u6760\u4ee3\u8868\u6362\u884c\uff0c\u53ef\u4ee5\u5ffd\u7565\uff09<br \/><\/span><\/p>\n<pre>nohup&nbsp;mysqldump&nbsp;-uroot&nbsp;-pxxxxx&nbsp;\n\u2014all-databases&nbsp;&amp;gt;&nbsp;\n.\/alldatabases.sql&nbsp;&amp;amp;\uff08xxxxx\u662f\u5bc6\u7801\uff09<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5f53\u7136\u5982\u679c\u4f60\u4e0d\u60f3\u5bc6\u7801\u660e\u6587\uff0c\u4f60\u8fd8\u53ef\u4ee5\u8fd9\u4e48\u505a\uff1a<br \/><\/span><\/p>\n<pre>nohup&nbsp;mysqldump&nbsp;-uroot&nbsp;-pxxxxx&nbsp;\n\u2014all-databases&nbsp;\n&amp;gt;&nbsp;.\/alldatabases.sql&nbsp;\uff08\u540e\u9762\u4e0d\u52a0&amp;amp;\u7b26\u53f7\uff09<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u6267\u884c\u4e86\u4e0a\u8ff0\u547d\u4ee4\u540e\uff0c\u4f1a\u63d0\u793a\u53eb\u4f60\u8f93\u5165\u5bc6\u7801\uff0c\u8f93\u5165\u5bc6\u7801\u540e\uff0c\u8be5\u547d\u4ee4\u8fd8\u5728\u524d\u53f0\u8fd0\u884c\uff0c\u4f46\u662f\u6211\u4eec\u7684\u76ee\u7684\u662f\u540e\u5929\u8fd0\u884c\u8be5\u547d\u4ee4\uff0c\u8fd9\u4e2a\u65f6\u5019\u4f60\u53ef\u4ee5\u6309\u4e0bCtrl+Z\uff0c\u7136\u540e\u5728\u8f93\u5165bg\u5c31\u53ef\u4ee5\u8fbe\u5230\u7b2c\u4e00\u4e2a\u547d\u4ee4\u7684\u6548\u679c\uff0c\u8ba9\u8be5\u547d\u4ee4\u540e\u53f0\u8fd0\u884c\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u8ba9\u5bc6\u7801\u9690\u853d\u8f93\u5165\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u547d\u4ee4\u540e\u53f0\u6267\u884c\u7684\u7ed3\u679c\u4f1a\u5728\u547d\u4ee4\u6267\u884c\u7684\u5f53\u524d\u76ee\u5f55\u4e0b\u7559\u4e0b\u4e00\u4e2anohup.out\u6587\u4ef6\uff0c\u67e5\u770b\u8fd9\u4e2a\u6587\u4ef6\u5c31\u77e5\u9053\u547d\u4ee4\u6709\u6ca1\u6709\u6267\u884c\u62a5\u9519\u7b49\u4fe1\u606f\u3002<\/span><\/p>\n<p><span style=\"font-size: 20px\"><strong>\u4e09\u3001\u627e\u51fa\u5f53\u524d\u7cfb\u7edf\u5185\u5b58\u4f7f\u7528\u91cf\u8f83\u9ad8\u7684\u8fdb\u7a0b<\/strong><\/span><\/p>\n<p> <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5728\u5f88\u591a\u8fd0\u7ef4\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53d1\u73b0\u5185\u5b58\u8017\u7528\u8f83\u4e3a\u4e25\u91cd\uff0c\u90a3\u4e48\u600e\u4e48\u6837\u624d\u80fd\u627e\u51fa\u5185\u5b58\u6d88\u8017\u7684\u8fdb\u7a0b\u6392\u5e8f\u5462\uff1f<br \/>\u547d\u4ee4\uff1a<\/span><\/p>\n<pre>ps&nbsp;-aux&nbsp;|&nbsp;sort&nbsp;-rnk&nbsp;4&nbsp;|&nbsp;head&nbsp;-20<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-bottom: 0em;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/7f48a29fb163774c1f91c184d630035d-2.jpg\" class=\"aligncenter\" title=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe2\" alt=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe2\" \/><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 5px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u8f93\u51fa\u7684\u7b2c4\u5217\u5c31\u662f\u5185\u5b58\u7684\u8017\u7528\u767e\u5206\u6bd4\u3002\u6700\u540e\u4e00\u5217\u5c31\u662f\u76f8\u5bf9\u5e94\u7684\u8fdb\u7a0b\u3002<\/span><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 5px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><\/p>\n<p><span style=\"font-size: 20px\"><strong>\u56db\u3001\u627e\u51fa\u5f53\u524d\u7cfb\u7edfCPU\u4f7f\u7528\u91cf\u8f83\u9ad8\u7684\u8fdb\u7a0b<\/strong><\/span><\/p>\n<p><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5728\u5f88\u591a\u8fd0\u7ef4\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53d1\u73b0CPU\u8017\u7528\u8f83\u4e3a\u4e25\u91cd\uff0c\u90a3\u4e48\u600e\u4e48\u6837\u624d\u80fd\u627e\u51faCPU\u6d88\u8017\u7684\u8fdb\u7a0b\u6392\u5e8f\u5462\uff1f<br \/>\u547d\u4ee4\uff1a<\/span><\/p>\n<pre>ps&nbsp;-aux&nbsp;|&nbsp;sort&nbsp;-rnk&nbsp;3&nbsp;|&nbsp;head&nbsp;-20<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-bottom: 0em;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/7f48a29fb163774c1f91c184d630035d-3.jpg\" class=\"aligncenter\" title=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe3\" alt=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe3\" \/><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u8f93\u51fa\u7684\u7b2c3\u5217\u4e3aCPU\u7684\u8017\u7528\u767e\u5206\u6bd4\uff0c\u6700\u540e\u4e00\u5217\u5c31\u662f\u5bf9\u5e94\u7684\u8fdb\u7a0b\u3002<\/span><\/p>\n<pre>\u725b\u903c\u554a\uff01\u63a5\u79c1\u6d3b\u5fc5\u5907\u7684&nbsp;N&nbsp;\u4e2a\u5f00\u6e90\u9879\u76ee\uff01\u8d76\u5feb\u6536\u85cf<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\"><\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u6211\u60f3\u5927\u5bb6\u5e94\u8be5\u4e5f\u53d1\u73b0\u4e86\uff0csort \u547d\u4ee4\u540e\u76843\u30014\u5176\u5b9e\u5c31\u662f\u4ee3\u8868\u7740\u7b2c3\u5217\u8fdb\u884c\u6392\u5e8f\u3001\u7b2c4\u5217\u8fdb\u884c\u6392\u5e8f\u3002<\/span><\/p>\n<p><span style=\"font-size: 20px\"><strong>\u4e94\u3001\u540c\u65f6\u67e5\u770b\u591a\u4e2a\u65e5\u5fd7\u6216\u6570\u636e\u6587\u4ef6<\/strong><\/span><\/p>\n<p> <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\uff0c\u6211\u4eec\u67e5\u770b\u65e5\u5fd7\u6587\u4ef6\u7684\u65b9\u5f0f\u53ef\u80fd\u662f\u4f7f\u7528tail\u547d\u4ee4\u5728\u4e00\u4e2a\u4e2a\u7684\u7ec8\u7aef\u67e5\u770b\u65e5\u5fd7\u6587\u4ef6\uff0c\u4e00\u4e2a\u7ec8\u7aef\u5c31\u770b\u4e00\u4e2a\u65e5\u5fd7\u6587\u4ef6\u3002\u5305\u62ec\u6211\u5728\u5185\u4e5f\u662f\uff0c\u4f46\u662f\u6709\u65f6\u5019\u4e5f\u4f1a\u89c9\u5f97\u8fd9\u79cd\u65b9\u5f0f\u7565\u663e\u9ebb\u70e6\uff0c\u5176\u5b9e\u6709\u4e2a\u5de5\u5177\u53eb\u505amultitail\u53ef\u4ee5\u5728\u540c\u4e00\u4e2a\u7ec8\u7aef\u540c\u65f6\u67e5\u770b\u591a\u4e2a\u65e5\u5fd7\u6587\u4ef6\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u9996\u5148\u5b89\u88c5multitail\uff1a<\/span><\/p>\n<pre>wget&nbsp;ftp:\/\/ftp.is.co.za\/mirror\/ftp.rpmforge.net\/redhat\/el6\/en\/x86_64\/dag\/RPMS\/multitail-5.2.9-1.el6.rf.x86_64.rpm\nyum&nbsp;-y&nbsp;localinstall&nbsp;multitail-5.2.9-1.el6.rf.x86_64.rpm<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 10px;margin-bottom: 10px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">multitail\u5de5\u5177\u652f\u6301\u6587\u672c\u7684\u9ad8\u4eae\u663e\u793a\uff0c\u5185\u5bb9\u8fc7\u6ee4\u4ee5\u53ca\u66f4\u591a\u4f60\u53ef\u80fd\u9700\u8981\u7684\u529f\u80fd\u3002<\/span><\/p>\n<p style=\"margin-top: 10px;margin-bottom: 10px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5982\u4e0b\u5c31\u6765\u4e00\u4e2a\u6709\u7528\u7684\u4f8b\u5b50\uff1a<br \/>\u6b64\u65f6\u6211\u4eec\u65e2\u60f3\u67e5\u770bsecure\u7684\u65e5\u5fd7\u6307\u5b9a\u8fc7\u6ee4\u5173\u952e\u5b57\u8f93\u51fa\uff0c\u53c8\u60f3\u67e5\u770b\u5b9e\u65f6\u7684\u7f51\u7edcping\u60c5\u51b5\uff1a<br \/>\u547d\u4ee4\u5982\u4e0b\uff1a<\/span><\/p>\n<pre>multitail&nbsp;-e&nbsp;\"Accepted\"&nbsp;\/var\/log\/secure&nbsp;-l&nbsp;\"ping&nbsp;baidu.com\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 10px;margin-bottom: 10px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\"><\/span><\/p>\n<p style=\"margin-bottom: 0em;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/7f48a29fb163774c1f91c184d630035d-4.jpg\" class=\"aligncenter\" title=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe4\" alt=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe4\" \/><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 5px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u4e0d\u662f\u5f88\u65b9\u4fbf\uff1f\u5982\u679c\u5e73\u65f6\u6211\u4eec\u60f3\u67e5\u770b\u4e24\u4e2a\u65e5\u5fd7\u4e4b\u95f4\u7684\u5173\u8054\u6027\uff0c\u53ef\u4ee5\u89c2\u5bdf\u65e5\u5fd7\u8f93\u51fa\u662f\u5426\u6709\u89e6\u53d1\u7b49\u3002\u5982\u679c\u5206\u5f00\u4e24\u4e2a\u7ec8\u7aef\u53ef\u80fd\u6765\u56de\u8fdb\u884c\u5207\u6362\u6709\u70b9\u6d6a\u8d39\u65f6\u95f4\uff0c\u8fd9\u4e2amultitail\u5de5\u5177\u67e5\u770b\u672a\u5c1d\u4e0d\u662f\u4e00\u4e2a\u597d\u65b9\u6cd5\u3002<\/span><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 5px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 5px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><\/p>\n<p><span style=\"font-size: 20px\"><strong>\u516d\u3001\u6301\u7eedping\u5e76\u5c06\u7ed3\u679c\u8bb0\u5f55\u5230\u65e5\u5fd7<\/strong><\/span><\/p>\n<p> <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5f88\u591a\u65f6\u5019\uff0c\u8fd0\u7ef4\u603b\u4f1a\u542c\u5230\u4e00\u4e2a\u58f0\u97f3\uff0c\u662f\u4e0d\u662f\u7f51\u7edc\u51fa\u4ec0\u4e48\u95ee\u9898\u4e86\u554a\uff0c\u5bfc\u81f4\u4e1a\u52a1\u51fa\u73b0\u602a\u5f02\u7684\u75c7\u72b6\uff0c\u80af\u5b9a\u662f\u670d\u52a1\u5668\u7f51\u7edc\u51fa\u95ee\u9898\u4e86\u3002\u8fd9\u4e2a\u5c31\u662f\u4fd7\u79f0\u7684\u80cc\u9505\uff0c\u4e1a\u52a1\u51fa\u4e86\u95ee\u9898\uff0c\u7b2c\u4e00\u65f6\u95f4\u76f8\u5173\u4eba\u5458\u627e\u4e0d\u5230\u539f\u56e0\u5f88\u591a\u60c5\u51b5\u4e0b\u5c31\u4f1a\u628a\u95ee\u9898\u5f52\u7ed3\u4e8e\u670d\u52a1\u5668\u7f51\u7edc\u6709\u95ee\u9898\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u8fd9\u4e2a\u65f6\u5019\u4f60\u53bbping\u51e0\u4e2a\u5305\u628a\u7ed3\u679c\u4e22\u51fa\u6765\uff0c\u4eba\u5bb6\u4f1a\u53cd\u9a73\u4f60\uff0c\u521a\u521a\u90a3\u6bb5\u65f6\u95f4\u6709\u95ee\u9898\u800c\u5df2\uff0c\u73b0\u5728\u4e1a\u52a1\u90fd\u6062\u590d\u6b63\u5e38\u4e86\uff0c\u7f51\u7edc\u80af\u5b9a\u6b63\u5e38\u554a\uff0c\u8fd9\u4e2a\u65f6\u5019\u4f30\u8ba1\u4f60\u8981\u6c14\u6b7b\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u4f60\u8981\u662f\u518d\u62ff\u51fazabbix\u7b49\u7f51\u7edc\u76d1\u63a7\u7684\u6570\u636e\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u4e0d\u592a\u59a5\u5f53\u4e86\uff0czabbix\u7684\u91c7\u96c6\u6570\u636e\u95f4\u9694\u4f60\u4e0d\u53ef\u80fd\u8bbe\u7f6e\u62101\u79d2\u949f1\u6b21\u5427\uff1f\u5c0f\u7f16\u5c31\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u95ee\u9898\uff0c\u7ed3\u679c\u6211\u901a\u8fc7\u4ee5\u4e0b\u7684\u547d\u4ee4\u8fdb\u884c\u4e86ping\u76d1\u63a7\u91c7\u96c6\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u7136\u540e\u518d\u6709\u4eba\u8ba9\u6211\u80cc\u9505\u7684\u65f6\u5019\uff0c\u6211\u628a\u51fa\u95ee\u9898\u65f6\u95f4\u6bb5\u7684ping\u6570\u636e\u5e93\u622a\u53d6\u51fa\u6765\uff0c\u5927\u5bb6\u516c\u5f00\u8c08\uff0c\u7ed3\u679c\u90a3\u6b21\u88ab\u6211\u53fc\u6760\u56de\u53bb\u4e86\uff0c\u4ee5\u540e\u4ed6\u4eec\u90fd\u4e0d\u6562\u8f7b\u6613\u7529\u9505\u4e86\uff0c\u8fd9\u4e2a\u611f\u89c9\u597d\u554a\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u547d\u4ee4\uff1a<br \/><\/span><\/p>\n<pre>ping&nbsp;api.jpush.cn&nbsp;|&nbsp;awk&nbsp;'{&nbsp;print&nbsp;$0&nbsp;\"&nbsp;\"&nbsp;strftime(\u201c%Y-%m-%d&nbsp;%H:%M:%S\u201d,systime())&nbsp;}'&nbsp;&amp;gt;&amp;gt;&nbsp;\/tmp\/jiguang.log&nbsp;&amp;amp;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u8f93\u51fa\u7684\u7ed3\u679c\u4f1a\u8bb0\u5f55\u5230\/tmp\/jiguang.log \u4e2d\uff0c\u6bcf\u79d2\u949f\u65b0\u589e\u4e00\u6761ping\u8bb0\u5f55\uff0c\u5982\u4e0b\uff1a<\/span><\/p>\n<p style=\"margin-bottom: 0em;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/263135ccb12b65754e3248a90e69aa06-5.jpg\" class=\"aligncenter\" title=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe5\" alt=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe5\" \/><\/p>\n<p><span style=\"font-size: 20px\"><strong>\u4e03\u3001\u67e5\u770btcp\u8fde\u63a5\u72b6\u6001<\/strong><\/span><\/p>\n<p> <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u6307\u5b9a\u67e5\u770b80\u7aef\u53e3\u7684tcp\u8fde\u63a5\u72b6\u6001\uff0c\u6709\u5229\u4e8e\u5206\u6790\u8fde\u63a5\u662f\u5426\u91ca\u653e\uff0c\u6216\u8005\u653b\u51fb\u65f6\u8fdb\u884c\u72b6\u6001\u5206\u6790\u3002\u53e6\u5916\uff0c\u641c\u7d22\u516c\u4f17\u53f7Java\u67b6\u6784\u5e08\u6280\u672f\u540e\u53f0\u56de\u590d\u201c\u9762\u8bd5\u9898\u201d\uff0c\u83b7\u53d6\u4e00\u4efd\u60ca\u559c\u793c\u5305\u3002<\/span><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u547d\u4ee4\uff1a<\/span><\/p>\n<pre>netstat&nbsp;-nat&nbsp;|awk&nbsp;'{print&nbsp;$6}'&nbsp;|sort|uniq&nbsp;-c|sort&nbsp;-rn<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\"><\/span><\/p>\n<p style=\"margin-bottom: 0em;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/263135ccb12b65754e3248a90e69aa06-6.png\" class=\"aligncenter\" title=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe6\" alt=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe6\" \/><\/p>\n<p><span style=\"font-size: 20px\"><strong>\u516b\u3001\u67e5\u627e80\u7aef\u53e3\u8bf7\u6c42\u6570\u6700\u9ad8\u7684\u524d20\u4e2aIP<\/strong><\/span><\/p>\n<p> <\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u6709\u65f6\u5019\u4e1a\u52a1\u7684\u8bf7\u6c42\u91cf\u7a81\u7136\u4e0a\u53bb\u4e86\uff0c\u90a3\u4e48\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u67e5\u770b\u4e0b\u8bf7\u6c42\u6765\u6e90IP\u60c5\u51b5\uff0c\u5982\u679c\u662f\u96c6\u4e2d\u5728\u5c11\u6570IP\u4e0a\u7684\uff0c\u90a3\u4e48\u53ef\u80fd\u662f\u5b58\u5728\u653b\u51fb\u884c\u4e3a\uff0c\u6211\u4eec\u4f7f\u7528\u9632\u706b\u5899\u5c31\u53ef\u4ee5\u8fdb\u884c\u5c01\u7981\u3002\u547d\u4ee4\u5982\u4e0b\uff1a<\/span><\/p>\n<pre>netstat&nbsp;-anlp|grep&nbsp;80|grep&nbsp;tcp|awk&nbsp;'{print&nbsp;$5}'&nbsp;|awk&nbsp;-F:&nbsp;'{print&nbsp;$1}'|sort|uniq&nbsp;-c|sort&nbsp;-nr|head&nbsp;-n20<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-bottom: 0em;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/263135ccb12b65754e3248a90e69aa06-7.png\" class=\"aligncenter\" title=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe7\" alt=\"\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u63d2\u56fe7\" \/><\/p>\n<p style=\"letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><\/p>\n<p><span style=\"font-size: 20px\"><strong>\u4e5d\u3001ssh\u5b9e\u73b0\u7aef\u53e3\u8f6c\u53d1<\/strong><\/span><\/p>\n<p> <\/p>\n<p style=\"margin-top: 10px;margin-bottom: 10px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u53ef\u80fd\u5f88\u591a\u7684\u670b\u53cb\u90fd\u542c\u8bf4\u8fc7ssh\u662f\u4e0b\u7684\u8fdc\u7a0b\u767b\u5f55\u5b89\u5168\u534f\u8bae\uff0c\u5c31\u662f\u901a\u4fd7\u7684\u8fdc\u7a0b\u767b\u5f55\u7ba1\u7406\u670d\u52a1\u5668\u3002\u4f46\u662f\u5e94\u8be5\u5f88\u5c11\u670b\u53cb\u4f1a\u542c\u8bf4\u8fc7ssh\u8fd8\u53ef\u4ee5\u505a\u7aef\u53e3\u8f6c\u53d1\u3002\u5176\u5b9essh\u7528\u6765\u505a\u7aef\u53e3\u8f6c\u53d1\u7684\u529f\u80fd\u8fd8\u662f\u5f88\u5f3a\u5927\u7684\uff0c\u4e0b\u9762\u5c31\u6765\u505a\u793a\u8303\u3002<\/span><\/p>\n<p style=\"margin-top: 10px;margin-bottom: 10px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u5b9e\u4f8b\u80cc\u666f\uff1a\u6211\u4eec\u516c\u53f8\u662f\u6709\u5821\u5792\u673a\u7684\uff0c\u4efb\u4f55\u64cd\u4f5c\u5747\u9700\u8981\u5728\u5821\u5792\u673a\u4e0a\u8fdb\u884c\uff0c\u6709\u5199\u5f00\u53d1\u4eba\u5458\u9700\u8981\u8bbf\u95eeELasticSearch\u7684head\u9762\u677f\u67e5\u770b\u96c6\u7fa4\u72b6\u6001\uff0c\u4f46\u662f\u6211\u4eec\u5e76\u4e0d\u60f3\u5c06ElasticSearch\u76849200\u7aef\u53e3\u6620\u5c04\u51fa\u53bb\uff0c\u4f9d\u7136\u60f3\u901a\u8fc7\u5821\u5792\u673a\u8fdb\u884c\u8bbf\u95ee\u3002\u6240\u4ee5\u624d\u4f1a\u5c06\u901a\u5f80\u5821\u5792\u673a\uff08192.168.1.15\uff09\u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u670d\u52a1\u5668ElasticSearch\uff08192.168.1.19\uff09\u76849200\u4e0a\u3002<\/span><\/p>\n<p style=\"margin-top: 10px;margin-bottom: 10px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u4f8b\u5b50\uff1a<br \/>\u5c06\u53d1\u5f80\u672c\u673a\uff08192.168.1.15\uff09\u76849200\u7aef\u53e3\u8bbf\u95ee\u8f6c\u53d1\u5230192.168.1.19\u76849200\u7aef\u53e3<br \/><\/span><\/p>\n<pre>ssh&nbsp;-p&nbsp;22&nbsp;-C&nbsp;-f&nbsp;-N&nbsp;-g&nbsp;-L&nbsp;9200:192.168.1.19:9200&nbsp;ihavecar@192.168.1.19<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 10px;margin-bottom: 10px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u8bb0\u4f4f\uff1a\u524d\u63d0\u662f\u5148\u8fdb\u884c\u79d8\u94a5\u4f20\u8f93\u3002<\/span><\/p>\n<p style=\"margin-top: 10px;margin-bottom: 10px;letter-spacing: 0.544px;font-family: -apple-system-font, BlinkMacSystemFont,\"><span style=\"font-size: 15px\">\u547d\u4ee4\u6267\u884c\u5b8c\u540e\uff0c\u8bbf\u95ee192.168.1.15:9200\u7aef\u53e3\u5219\u771f\u5b9e\u662f\u8bbf\u95ee192.168.1.19:9200\u7aef\u53e3\u3002<\/span><\/p>\n<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8d85\u5b9e\u7528\u7684 Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u7a0b\u5e8f\u5458\u4e00\u5b9a\u8981\u61c2\uff01\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u5728\u8fd0\u7ef4\u7684\u5751\u91cc\u6478\u722c\u6eda\u6253\u597d\u51e0\u5e74\u4e86\uff0c\u6211\u8fd8\u8bb0\u5f97\u6211\u521a\u5f00\u59cb\u7684\u65f6\u5019\uff0c\u6211\u53ea\u4f1a\u4f7f\u7528\u4e00\u4e9b\u7b80\u5355\u7684\u547d\u4ee4\uff0c\u5199\u811a\u672c\u7684\u65f6\u5019\uff0c\u4e5f\u662f\u8981\u591a\u7b80\u5355\u6709\u591a\u7b80\u5355\uff0c\u6240\u4ee5\u6709\u65f6\u5019\u5199\u51fa\u6765\u7684\u811a\u672c\u53c8\u957f\u53c8\u81ed\u3002 \u50cf\u4e00\u4e9b\u9ad8\u7ea7\u70b9\u7684\u547d\u4ee4\uff0c\u6bd4\u5982\u8bf4 Xargs \u547d\u4ee4\u3001\u7ba1\u9053\u547d\u4ee4\u3001\u81ea\u52a8\u5e94\u7b54\u547d\u4ee4\u7b49\uff0c\u5982\u679c\u5f53\u521d\u6211\u8981\u662f\u77e5\u9053\uff0c\u90a3\u6211\u4e5f\u53ef\u80fd\u5199\u51fa\u7b80\u6d01\u9ad8\u6548\u7684\u811a\u672c\u3002 \u4e0d\u7ba1\u51fa\u4e8e\u4efb\u4f55\u539f\u56e0\uff0c\u6211\u90fd\u60f3\u5bf9\u4e00\u4e9b Linux \u4f7f\u7528\u7684\u9ad8\u7ea7\u547d\u4ee4\u8fdb\u884c\u7528\u6cd5\u8bf4\u660e\uff0c\u5229\u4eba\u5229\u5df1\uff0c\u4ee5\u540e\u4e0d\u8bb0\u5f97\u7684\u8bdd\uff0c\u6211\u4e5f\u53ef\u4ee5\u56de\u5934\u7ffb\u6765\u770b\u770b\u3002 \u4e00\u3001\u5b9e\u7528\u7684 xargs \u547d\u4ee4 \u5728\u5e73\u65f6\u7684\u4f7f\u7528\u4e2d\uff0c\u6211\u8ba4\u4e3a xargs \u8fd9\u4e2a\u547d\u4ee4\u8fd8\u662f\u8f83\u4e3a\u91cd\u8981\u548c\u65b9\u4fbf\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\uff0c\u5c06\u547d\u4ee4\u8f93\u51fa\u7684\u7ed3\u679c\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u547d\u4ee4\u3002 \u6bd4\u5982\u8bf4\u6211\u4eec\u60f3\u627e\u51fa\u67d0\u4e2a\u8def\u5f84\u4e0b\u4ee5 .conf \u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u5e76\u5c06\u8fd9\u4e9b\u6587\u4ef6\u8fdb\u884c\u5206\u7c7b\uff0c\u90a3\u4e48\u666e\u901a\u7684\u505a\u6cd5\u5c31\u662f\u5148\u5c06\u4ee5 .conf \u7ed3\u5c3e\u7684\u6587\u4ef6\u5148\u627e\u51fa\u6765\uff0c\u7136\u540e\u8f93\u51fa\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u63a5\u7740 cat \u8fd9\u4e2a\u6587\u4ef6\uff0c\u5e76\u4f7f\u7528 file \u6587\u4ef6\u5206\u7c7b\u547d\u4ee4\u53bb\u5bf9\u8f93\u51fa\u7684\u6587\u4ef6\u8fdb\u884c\u5206\u7c7b\u3002 \u8fd9\u4e2a\u666e\u901a\u7684\u65b9\u6cd5\u8fd8\u7684\u786e\u662f\u7565\u663e\u9ebb\u70e6\uff0c\u90a3\u4e48\u8fd9\u4e2a\u65f6\u5019 xargs \u547d\u4ee4\u5c31\u6d3e\u4e0a\u7528\u573a\u4e86\u3002\u4f8b1\uff1a\u627e\u51fa \/ \u76ee\u5f55\u4e0b\u4ee5 .conf \u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u5e76\u8fdb\u884c\u6587\u4ef6\u5206\u7c7b\u547d\u4ee4\uff1a find&nbsp;\/&nbsp;-name&nbsp;*.conf&nbsp;-type&nbsp;f&nbsp; -print&nbsp;|&nbsp;xargs&nbsp;file \u767b\u5f55\u540e\u590d\u5236 \u8f93\u51fa\u7ed3\u679c\u5982\u4e0b\u6240\u793a\uff1a xargs \u540e\u9762\u4e0d\u4ec5\u4ec5\u53ef\u4ee5\u52a0\u6587\u4ef6\u5206\u7c7b\u7684\u547d\u4ee4\uff0c\u4f60\u8fd8\u53ef\u4ee5\u52a0\u5176\u4ed6\u7684\u5f88\u591a\u547d\u4ee4\uff0c\u6bd4\u5982\u8bf4\u5b9e\u5728\u4e00\u70b9\u7684tar\u547d\u4ee4\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528find\u547d\u4ee4\u914d\u5408tar\u547d\u4ee4\uff0c\u5c06\u6307\u5b9a\u8def\u5f84\u7684\u7279\u6b8a\u6587\u4ef6\u4f7f\u7528find\u547d\u4ee4\u627e\u51fa\u6765\uff0c\u7136\u540e\u914d\u5408tar\u547d\u4ee4\u5c06\u627e\u51fa\u7684\u6587\u4ef6\u76f4\u63a5\u6253\u5305\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a find&nbsp;\/&nbsp;-name&nbsp;*.conf&nbsp;-type&nbsp;f&nbsp; -print&nbsp;|&nbsp;xargs&nbsp;tar&nbsp;cjf&nbsp;test.tar.gz \u767b\u5f55\u540e\u590d\u5236 \u4e8c\u3001\u547d\u4ee4\u6216\u811a\u672c\u540e\u53f0\u8fd0\u884c \u6709\u65f6\u5019\u6211\u4eec\u8fdb\u884c\u4e00\u4e9b\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u4e0d\u5e0c\u671b\u6211\u4eec\u7684\u64cd\u4f5c\u5728\u7ec8\u7aef\u4f1a\u8bdd\u65ad\u4e86\u4e4b\u540e\u5c31\u8ddf\u7740\u65ad\u4e86\uff0c\u7279\u522b\u662f\u4e00\u4e9b\u6570\u636e\u5e93\u5bfc\u5165\u5bfc\u51fa\u64cd\u4f5c\uff0c\u5982\u679c\u6d89\u53ca\u5230\u5927\u6570\u636e\u91cf\u7684\u64cd\u4f5c\uff0c\u6211\u4eec\u4e0d\u53ef\u80fd\u4fdd\u8bc1\u6211\u4eec\u7684\u7f51\u7edc\u5728\u6211\u4eec\u7684\u64cd\u4f5c\u671f\u95f4\u4e0d\u51fa\u95ee\u9898\uff0c\u6240\u4ee5\u540e\u53f0\u8fd0\u884c\u811a\u672c\u6216\u8005\u547d\u4ee4\u5bf9\u6211\u4eec\u6765\u8bf4\u662f\u4e00\u5927\u4fdd\u969c\u3002 \u6bd4\u5982\u8bf4\u6211\u4eec\u60f3\u628a\u6570\u636e\u5e93\u7684\u5bfc\u51fa\u64cd\u4f5c\u540e\u53f0\u8fd0\u884c\uff0c\u5e76\u4e14\u5c06\u547d\u4ee4\u7684\u64cd\u4f5c\u8f93\u51fa\u8bb0\u5f55\u5230\u6587\u4ef6\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u8fd9\u4e48\u505a\uff1a\uff08\u53cd\u659c\u6760\u4ee3\u8868\u6362\u884c\uff0c\u53ef\u4ee5\u5ffd\u7565\uff09 nohup&nbsp;mysqldump&nbsp;-uroot&nbsp;-pxxxxx&nbsp; \u2014all-databases&nbsp;&amp;gt;&nbsp; .\/alldatabases.sql&nbsp;&amp;amp;\uff08xxxxx\u662f\u5bc6\u7801\uff09 \u767b\u5f55\u540e\u590d\u5236 \u5f53\u7136\u5982\u679c\u4f60\u4e0d\u60f3\u5bc6\u7801\u660e\u6587\uff0c\u4f60\u8fd8\u53ef\u4ee5\u8fd9\u4e48\u505a\uff1a nohup&nbsp;mysqldump&nbsp;-uroot&nbsp;-pxxxxx&nbsp; \u2014all-databases&nbsp; &amp;gt;&nbsp;.\/alldatabases.sql&nbsp;\uff08\u540e\u9762\u4e0d\u52a0&amp;amp;\u7b26\u53f7\uff09 \u767b\u5f55\u540e\u590d\u5236 \u6267\u884c\u4e86\u4e0a\u8ff0\u547d\u4ee4\u540e\uff0c\u4f1a\u63d0\u793a\u53eb\u4f60\u8f93\u5165\u5bc6\u7801\uff0c\u8f93\u5165\u5bc6\u7801\u540e\uff0c\u8be5\u547d\u4ee4\u8fd8\u5728\u524d\u53f0\u8fd0\u884c\uff0c\u4f46\u662f\u6211\u4eec\u7684\u76ee\u7684\u662f\u540e\u5929\u8fd0\u884c\u8be5\u547d\u4ee4\uff0c\u8fd9\u4e2a\u65f6\u5019\u4f60\u53ef\u4ee5\u6309\u4e0bCtrl+Z\uff0c\u7136\u540e\u5728\u8f93\u5165bg\u5c31\u53ef\u4ee5\u8fbe\u5230\u7b2c\u4e00\u4e2a\u547d\u4ee4\u7684\u6548\u679c\uff0c\u8ba9\u8be5\u547d\u4ee4\u540e\u53f0\u8fd0\u884c\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u8ba9\u5bc6\u7801\u9690\u853d\u8f93\u5165\u3002 \u547d\u4ee4\u540e\u53f0\u6267\u884c\u7684\u7ed3\u679c\u4f1a\u5728\u547d\u4ee4\u6267\u884c\u7684\u5f53\u524d\u76ee\u5f55\u4e0b\u7559\u4e0b\u4e00\u4e2anohup.out\u6587\u4ef6\uff0c\u67e5\u770b\u8fd9\u4e2a\u6587\u4ef6\u5c31\u77e5\u9053\u547d\u4ee4\u6709\u6ca1\u6709\u6267\u884c\u62a5\u9519\u7b49\u4fe1\u606f\u3002 \u4e09\u3001\u627e\u51fa\u5f53\u524d\u7cfb\u7edf\u5185\u5b58\u4f7f\u7528\u91cf\u8f83\u9ad8\u7684\u8fdb\u7a0b \u5728\u5f88\u591a\u8fd0\u7ef4\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53d1\u73b0\u5185\u5b58\u8017\u7528\u8f83\u4e3a\u4e25\u91cd\uff0c\u90a3\u4e48\u600e\u4e48\u6837\u624d\u80fd\u627e\u51fa\u5185\u5b58\u6d88\u8017\u7684\u8fdb\u7a0b\u6392\u5e8f\u5462\uff1f\u547d\u4ee4\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-62076","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/62076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=62076"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/62076\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=62076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=62076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=62076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}