{"id":19923,"date":"2025-04-19T02:27:05","date_gmt":"2025-04-18T18:27:05","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/19923.html"},"modified":"2025-04-19T02:27:05","modified_gmt":"2025-04-18T18:27:05","slug":"shell%e5%bc%80%e5%8f%91%e5%ae%9e%e8%b7%b5%ef%bc%9a%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84%e7%a3%81%e7%9b%98%e3%80%81cpu%e3%80%81%e5%86%85%e5%ad%98%e7%9a%84%e5%8d%a0%e7%94%a8%e7%9b%91%e6%8e%a7","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/19923.html","title":{"rendered":"Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418182701-68029975d16ad.gif\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>&#x1f3c6;\u4f5c\u8005\u7b80\u4ecb&#xff0c;\u9ed1\u591c\u5f00\u53d1\u8005&#xff0c;CSDN\u9886\u519b\u4eba\u7269&#xff0c;\u5168\u6808\u9886\u57df\u4f18\u8d28\u521b\u4f5c\u8005\u270c&#xff0c;CSDN\u535a\u5ba2\u4e13\u5bb6&#xff0c;\u963f\u91cc\u4e91\u793e\u533a\u4e13\u5bb6\u535a\u4e3b&#xff0c;2023\u5e746\u6708CSDN\u4e0a\u6d77\u8d5b\u9053top4\u3002 &#x1f3c6;\u6570\u5e74\u7535\u5546\u884c\u4e1a\u4ece\u4e1a\u7ecf\u9a8c&#xff0c;\u5386\u4efb\u6838\u5fc3\u7814\u53d1\u5de5\u7a0b\u5e08&#xff0c;\u9879\u76ee\u6280\u672f\u8d1f\u8d23\u4eba\u3002 &#x1f389;\u6b22\u8fce &#x1f44d;\u70b9\u8d5e\u270d\u8bc4\u8bba\u2b50\u6536\u85cf<\/p>\n<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>&#x1f680;\u4e00\u3001\u524d\u8a00<\/li>\n<li>&#x1f680;\u4e8c\u3001\u5173\u4e8e\u4ed6\u4eec<\/li>\n<li>\n<ul>\n<li>&#x1f50e;2.1 CPU&#xff08;\u4e2d\u592e\u5904\u7406\u5668&#xff09;<\/li>\n<li>&#x1f50e;2.2 \u5185\u5b58&#xff08;\u4e5f\u79f0\u4e3a\u968f\u673a\u5b58\u53d6\u5b58\u50a8\u5668RAM&#xff09;<\/li>\n<li>&#x1f50e;2.3 \u78c1\u76d8&#xff08;\u786c\u76d8\u9a71\u52a8\u5668&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>&#x1f680;\u4e09\u3001\u76d1\u63a7\u5b9e\u73b0<\/li>\n<li>\n<ul>\n<li>&#x1f50e;3.1 \u76d1\u63a7CPU<\/li>\n<li>&#x1f50e;3.2 \u76d1\u63a7\u5185\u5b58<\/li>\n<li>&#x1f50e;3.3 \u76d1\u63a7\u78c1\u76d8<\/li>\n<\/ul>\n<\/li>\n<li>&#x1f680;\u56db\u3001\u914d\u7f6ecrontab<\/li>\n<li>&#x1f680;\u4e94\u3001\u603b\u7ed3<\/li>\n<\/ul>\n<hr \/>\n<h2>&#x1f680;\u4e00\u3001\u524d\u8a00<\/h2>\n<p>CPU\u3001\u5185\u5b58\u548c\u78c1\u76d8\u662f\u8ba1\u7b97\u673a\u4e2d\u91cd\u8981\u4e14\u76f8\u4e92\u4f9d\u8d56\u7684\u7ec4\u4ef6\u3002CPU\u6267\u884c\u8fd0\u7b97\u548c\u63a7\u5236\u6307\u4ee4&#xff0c;\u5185\u5b58\u63d0\u4f9b\u4e34\u65f6\u5b58\u50a8\u7a7a\u95f4\u7528\u4e8e\u5b58\u50a8CPU\u9700\u8981\u5904\u7406\u7684\u6570\u636e\u548c\u6307\u4ee4&#xff0c;\u800c\u78c1\u76d8\u5219\u63d0\u4f9b\u957f\u671f\u5b58\u50a8\u7684\u529f\u80fd\u3002\u5b83\u4eec\u5171\u540c\u5de5\u4f5c\u4ee5\u5b9e\u73b0\u8ba1\u7b97\u673a\u7684\u6b63\u5e38\u8fd0\u884c\u548c\u6570\u636e\u5904\u7406\u4efb\u52a1\u3002<\/p>\n<p>\u672c\u6587\u4e3b\u8981\u901a\u8fc7shell\u5b9e\u73b0\u5982\u4f55\u76d1\u63a7\u4ed6\u4eec\u7684\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418182701-68029975e79eb.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>&#x1f680;\u4e8c\u3001\u5173\u4e8e\u4ed6\u4eec<\/h2>\n<h3>&#x1f50e;2.1 CPU&#xff08;\u4e2d\u592e\u5904\u7406\u5668&#xff09;<\/h3>\n<p>\u662f\u8ba1\u7b97\u673a\u7684\u6838\u5fc3\u7ec4\u4ef6\u4e4b\u4e00&#xff0c;\u8d1f\u8d23\u6267\u884c\u8ba1\u7b97\u673a\u6307\u4ee4\u548c\u63a7\u5236\u8ba1\u7b97\u673a\u7684\u64cd\u4f5c\u3002\u5b83\u662f\u8ba1\u7b97\u673a\u7684\u201c\u5927\u8111\u201d&#xff0c;\u51b3\u5b9a\u4e86\u8ba1\u7b97\u673a\u7684\u8fd0\u884c\u901f\u5ea6\u548c\u6027\u80fd\u3002CPU\u5305\u542b\u591a\u4e2a\u6838\u5fc3&#xff0c;\u6bcf\u4e2a\u6838\u5fc3\u53ef\u4ee5\u6267\u884c\u4e00\u4e2a\u6216\u591a\u4e2a\u7ebf\u7a0b\u7684\u6307\u4ee4\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418182702-680299765cc3a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>&#x1f50e;2.2 \u5185\u5b58&#xff08;\u4e5f\u79f0\u4e3a\u968f\u673a\u5b58\u53d6\u5b58\u50a8\u5668RAM&#xff09;<\/h3>\n<p>\u662f\u8ba1\u7b97\u673a\u7528\u4e8e\u5b58\u50a8\u6570\u636e\u548c\u6307\u4ee4\u7684\u5730\u65b9\u3002\u5b83\u662f\u4e34\u65f6\u5b58\u50a8\u5668&#xff0c;\u8fd9\u610f\u5473\u7740\u5f53\u8ba1\u7b97\u673a\u5173\u95ed\u6216\u65ad\u7535\u65f6&#xff0c;\u5176\u4e2d\u7684\u6570\u636e\u4f1a\u4e22\u5931\u3002\u5185\u5b58\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\u5b58\u50a8\u6570\u636e&#xff0c;\u5e76\u5177\u6709\u4e0d\u540c\u7684\u8bbf\u95ee\u901f\u5ea6\u548c\u5bb9\u91cf\u3002\u8ba1\u7b97\u673a\u5c06\u9700\u8981\u5904\u7406\u7684\u6570\u636e\u548c\u6307\u4ee4\u4ece\u78c1\u76d8\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d&#xff0c;\u7136\u540eCPU\u4ece\u5185\u5b58\u4e2d\u83b7\u53d6\u6570\u636e\u5e76\u8fdb\u884c\u5904\u7406\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418182702-68029976bc215.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>&#x1f50e;2.3 \u78c1\u76d8&#xff08;\u786c\u76d8\u9a71\u52a8\u5668&#xff09;<\/h3>\n<p>\u662f\u8ba1\u7b97\u673a\u7528\u4e8e\u957f\u671f\u5b58\u50a8\u6570\u636e\u548c\u7a0b\u5e8f\u7684\u8bbe\u5907\u3002\u76f8\u6bd4\u5185\u5b58&#xff0c;\u78c1\u76d8\u7684\u5bb9\u91cf\u66f4\u5927&#xff0c;\u4f46\u8bfb\u5199\u901f\u5ea6\u8f83\u6162\u3002\u78c1\u76d8\u901a\u5e38\u662f\u975e\u6613\u5931\u6027\u5b58\u50a8\u5668&#xff0c;\u8fd9\u610f\u5473\u7740\u5373\u4f7f\u8ba1\u7b97\u673a\u5173\u95ed\u6216\u65ad\u7535&#xff0c;\u5176\u4e2d\u7684\u6570\u636e\u4e5f\u80fd\u4fdd\u6301\u4e0d\u53d8\u3002\u78c1\u76d8\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u76d8\u7247\u7ec4\u6210&#xff0c;\u8fd9\u4e9b\u76d8\u7247\u901a\u8fc7\u78c1\u5934\u6765\u8bfb\u53d6\u548c\u5199\u5165\u6570\u636e\u3002\u8ba1\u7b97\u673a\u901a\u8fc7\u64cd\u4f5c\u7cfb\u7edf\u548c\u6587\u4ef6\u7cfb\u7edf\u6765\u7ba1\u7406\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418182703-680299776267b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>&#x1f680;\u4e09\u3001\u76d1\u63a7\u5b9e\u73b0<\/h2>\n<h3>&#x1f50e;3.1 \u76d1\u63a7CPU<\/h3>\n<p>\u8981\u7f16\u5199\u4e00\u4e2ashell\u811a\u672c\u6765\u76d1\u63a7CPU\u5360\u7528\u5927\u5c0f&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4top\u6765\u83b7\u53d6\u7cfb\u7edf\u7684CPU\u4fe1\u606f&#xff0c;\u5e76\u89e3\u6790\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u7684shell\u811a\u672c\u4ee3\u7801&#xff0c;\u8be5\u811a\u672c\u4f1a\u5faa\u73af\u8bfb\u53d6CPU\u7684\u5360\u7528\u60c5\u51b5&#xff0c;\u5e76\u5728\u7b26\u5408\u6761\u4ef6\u65f6\u8f93\u51fa\u63d0\u793a\u4fe1\u606f\u3002<\/p>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><\/p>\n<p><span class=\"token comment\"># \u8bbe\u7f6e\u9608\u503c&#xff0c;\u5f53CPU\u5360\u7528\u8d85\u8fc7\u8be5\u9608\u503c\u65f6\u8fdb\u884c\u8f93\u51fa\u63d0\u793a<\/span><br \/>\n<span class=\"token assign-left variable\">threshold<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">80<\/span><\/p>\n<p><span class=\"token keyword\">while<\/span> <span class=\"token boolean\">true<\/span><br \/>\n<span class=\"token keyword\">do<\/span><br \/>\n    <span class=\"token comment\"># \u4f7f\u7528top\u547d\u4ee4\u83b7\u53d6CPU\u5360\u7528\u4fe1\u606f&#xff0c;\u5e76\u4f7f\u7528grep\u548cawk\u7b5b\u9009\u548c\u89e3\u6790\u8f93\u51fa\u7ed3\u679c<\/span><br \/>\n    <span class=\"token assign-left variable\">cpu_usage<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">top<\/span> <span class=\"token parameter variable\">-bn<\/span> <span class=\"token number\">1<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token string\">&#034;%Cpu(s)&#034;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $2}&#039;<\/span><span class=\"token variable\">)<\/span><\/span><\/p>\n<p>    <span class=\"token comment\"># \u5c06\u6d6e\u70b9\u6570\u8f6c\u6362\u4e3a\u6574\u6570&#xff0c;\u4ee5\u4fbf\u8fdb\u884c\u6bd4\u8f83<\/span><br \/>\n    <span class=\"token assign-left variable\">cpu_usage<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\">${cpu_usage<span class=\"token operator\">%<\/span>.*}<\/span><\/p>\n<p>    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;Current CPU Usage: <span class=\"token variable\">${cpu_usage}<\/span>%&#034;<\/span><\/p>\n<p>    <span class=\"token comment\"># \u68c0\u67e5CPU\u5360\u7528\u662f\u5426\u8d85\u8fc7\u9608\u503c<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token variable\">$cpu_usage<\/span> <span class=\"token parameter variable\">-gt<\/span> <span class=\"token variable\">$threshold<\/span> <span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token keyword\">then<\/span><br \/>\n        <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;CPU Usage Exceeded Threshold!&#034;<\/span><br \/>\n        <span class=\"token comment\"># \u5728\u6b64\u5904\u6dfb\u52a0\u5176\u4ed6\u64cd\u4f5c\u6216\u901a\u77e5\u673a\u5236<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><\/p>\n<p>    <span class=\"token comment\"># \u5b9a\u4e49\u95f4\u9694\u65f6\u95f4&#xff0c;\u4ee5\u63a7\u5236\u68c0\u67e5\u9891\u7387<\/span><br \/>\n    <span class=\"token function\">sleep<\/span> <span class=\"token number\">5<\/span><br \/>\n<span class=\"token keyword\">done<\/span><\/p>\n<p>\u4ee5\u4e0a\u4ee3\u7801\u4e2d&#xff0c;threshold\u53d8\u91cf\u5b9a\u4e49\u4e86\u8bbe\u5b9a\u7684\u9608\u503c&#xff0c;\u5982\u679cCPU\u5360\u7528\u8d85\u8fc7\u8be5\u9608\u503c&#xff0c;\u5c06\u8f93\u51fa\u8b66\u544a\u4fe1\u606f\u3002top\u547d\u4ee4\u7528\u4e8e\u83b7\u53d6\u7cfb\u7edf\u7684CPU\u5360\u7528\u60c5\u51b5&#xff0c;grep\u548cawk\u7528\u4e8e\u7b5b\u9009\u548c\u89e3\u6790\u8f93\u51fa\u7ed3\u679c\u3002sleep\u547d\u4ee4\u5b9a\u4e49\u4e86\u5faa\u73af\u7684\u95f4\u9694\u65f6\u95f4&#xff0c;\u8fd9\u91cc\u8bbe\u7f6e\u4e3a5\u79d2\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u81ea\u5b9a\u4e49\u811a\u672c\u4e2d\u7684\u9608\u503c\u3001\u8f93\u51fa\u4fe1\u606f\u548c\u5176\u4ed6\u64cd\u4f5c\u3002<\/p>\n<h3>&#x1f50e;3.2 \u76d1\u63a7\u5185\u5b58<\/h3>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 free \u547d\u4ee4\u6765\u83b7\u53d6\u5f53\u524d\u7cfb\u7edf\u7684\u5185\u5b58\u5360\u7528\u60c5\u51b5&#xff0c;\u5e76\u4f7f\u7528 awk \u547d\u4ee4\u6765\u63d0\u53d6\u9700\u8981\u7684\u4fe1\u606f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/p>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><\/p>\n<p><span class=\"token comment\"># \u8bbe\u7f6e\u9608\u503c&#xff0c;\u5f53\u5185\u5b58\u5360\u7528\u8d85\u8fc7\u8be5\u9608\u503c\u65f6\u53d1\u9001\u8b66\u544a<\/span><br \/>\n<span class=\"token assign-left variable\">threshold<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">80<\/span><\/p>\n<p><span class=\"token keyword\">while<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">do<\/span><br \/>\n    <span class=\"token comment\"># \u4f7f\u7528 free \u547d\u4ee4\u83b7\u53d6\u5185\u5b58\u5360\u7528\u60c5\u51b5&#xff0c;\u5e76\u4f7f\u7528 awk \u63d0\u53d6\u7b2c\u4e09\u884c\u7684\u6570\u636e<\/span><br \/>\n    <span class=\"token assign-left variable\">mem_info<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">free<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;NR&#061;&#061;3{print $3\/$2 * 100}&#039;<\/span><span class=\"token variable\">)<\/span><\/span><\/p>\n<p>    <span class=\"token comment\"># \u6bd4\u8f83\u5185\u5b58\u5360\u7528\u60c5\u51b5\u548c\u9608\u503c<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token variable\"><span class=\"token punctuation\">((<\/span> $<span class=\"token punctuation\">(<\/span>echo &#034;$mem_info <span class=\"token operator\">&gt;<\/span> $threshold&#034; <span class=\"token operator\">|<\/span> bc <span class=\"token operator\">&#8211;<\/span>l<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">))<\/span><\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u5185\u5b58\u5360\u7528\u8d85\u8fc7\u9608\u503c(<span class=\"token variable\">$threshold<\/span>%)&#xff0c;\u5f53\u524d\u5360\u7528\u4e3a&#xff1a;<span class=\"token variable\">$mem_info<\/span>%&#034;<\/span><br \/>\n        <span class=\"token comment\"># \u5728\u6b64\u5904\u6dfb\u52a0\u53d1\u9001\u8b66\u544a\u7684\u4ee3\u7801<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><\/p>\n<p>    <span class=\"token comment\"># \u7b49\u5f85\u4e00\u6bb5\u65f6\u95f4\u540e\u518d\u6b21\u76d1\u63a7<\/span><br \/>\n    <span class=\"token function\">sleep<\/span> <span class=\"token number\">5<\/span><br \/>\n<span class=\"token keyword\">done<\/span><\/p>\n<p>\u5728\u811a\u672c\u4e2d&#xff0c;free \u547d\u4ee4\u7528\u4e8e\u83b7\u53d6\u5185\u5b58\u5360\u7528\u60c5\u51b5&#xff0c;\u5176\u4e2d awk &#039;NR&#061;&#061;3{print $3\/$2 * 100}&#039; \u8868\u793a\u63d0\u53d6 free \u547d\u4ee4\u8f93\u51fa\u7684\u7b2c\u4e09\u884c&#xff08;\u5305\u542b\u5185\u5b58\u5360\u7528\u4fe1\u606f&#xff09;&#xff0c;\u5e76\u8ba1\u7b97\u5185\u5b58\u5360\u7528\u767e\u5206\u6bd4\u3002\u4e0e\u9608\u503c\u8fdb\u884c\u6bd4\u8f83\u540e&#xff0c;\u5982\u679c\u8d85\u8fc7\u9608\u503c&#xff0c;\u5219\u8f93\u51fa\u8b66\u544a\u4fe1\u606f\u3002\u4f60\u53ef\u4ee5\u5728\u8b66\u544a\u90e8\u5206\u52a0\u5165\u53d1\u9001\u90ae\u4ef6\u6216\u5176\u4ed6\u901a\u77e5\u7684\u4ee3\u7801\u3002<\/p>\n<p>\u811a\u672c\u4e2d\u4f7f\u7528 sleep 5 \u8868\u793a\u6bcf\u9694 5 \u79d2\u91cd\u65b0\u68c0\u67e5\u4e00\u6b21\u5185\u5b58\u5360\u7528\u60c5\u51b5&#xff0c;\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u66f4\u6539\u8be5\u503c\u3002\u5c06\u4ee5\u4e0a\u4ee3\u7801\u4fdd\u5b58\u4e3a\u811a\u672c\u6587\u4ef6&#xff08;\u6bd4\u5982 memory_monitor.sh&#xff09;&#xff0c;\u5e76\u901a\u8fc7 chmod &#043;x memory_monitor.sh \u547d\u4ee4\u7ed9\u4e88\u6267\u884c\u6743\u9650\u540e&#xff0c;\u5c31\u53ef\u4ee5\u8fd0\u884c\u8be5\u811a\u672c\u6765\u76d1\u63a7\u5185\u5b58\u5360\u7528\u60c5\u51b5\u4e86\u3002<\/p>\n<h3>&#x1f50e;3.3 \u76d1\u63a7\u78c1\u76d8<\/h3>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528df\u547d\u4ee4\u6765\u83b7\u53d6\u78c1\u76d8\u5360\u7528\u60c5\u51b5&#xff0c;\u7136\u540e\u7f16\u5199\u4e00\u4e2ashell\u811a\u672c\u6765\u76d1\u63a7\u78c1\u76d8\u5360\u7528\u5927\u5c0f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/p>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><\/p>\n<p><span class=\"token comment\"># \u8bbe\u7f6e\u9608\u503c&#xff0c;\u5f53\u78c1\u76d8\u4f7f\u7528\u7387\u8d85\u8fc7\u8be5\u9608\u503c\u65f6\u53d1\u9001\u8b66\u62a5<\/span><br \/>\n<span class=\"token assign-left variable\">THRESHOLD<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">90<\/span><\/p>\n<p><span class=\"token comment\"># \u83b7\u53d6\u78c1\u76d8\u4f7f\u7528\u7387&#xff0c;\u5e76\u63d0\u53d6\u767e\u5206\u6bd4\u90e8\u5206<\/span><br \/>\n<span class=\"token assign-left variable\">usage<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-h<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;$NF&#061;&#061;&#034;\/&#034;{printf &#034;%s\\\\n&#034;, $5}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">cut<\/span> -d<span class=\"token string\">&#039;%&#039;<\/span> <span class=\"token parameter variable\">-f1<\/span><span class=\"token variable\">)<\/span><\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5\u78c1\u76d8\u4f7f\u7528\u7387\u662f\u5426\u8d85\u8fc7\u9608\u503c<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token variable\">$usage<\/span> <span class=\"token parameter variable\">-gt<\/span> <span class=\"token variable\">$THRESHOLD<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u78c1\u76d8\u4f7f\u7528\u7387\u8d85\u8fc7\u9608\u503c&#xff0c;\u8bf7\u53ca\u65f6\u6e05\u7406&#xff01;&#034;<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p>\u5c06\u4e0a\u8ff0\u4ee3\u7801\u4fdd\u5b58\u5230\u4e00\u4e2a\u6587\u4ef6&#xff08;\u4f8b\u5982check_disk_usage.sh&#xff09;&#xff0c;\u7136\u540e\u901a\u8fc7\u8fd0\u884c bash check_disk_usage.sh \u6216\u8005 .\/check_disk_usage.sh \u6765\u6267\u884c\u811a\u672c\u3002<\/p>\n<p>\u8bf7\u6ce8\u610f&#xff0c;\u5373\u4f7f\u8fd9\u4e2a\u811a\u672c\u53ef\u4ee5\u76d1\u63a7\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5&#xff0c;\u4f46\u5b83\u5e76\u4e0d\u4f1a\u6301\u7eed\u76d1\u63a7\u3002\u4f60\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u5b9a\u65f6\u4efb\u52a1\u5de5\u5177&#xff08;\u5982cron&#xff09;\u6765\u5b9a\u671f\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c&#xff0c;\u4ee5\u4fbf\u5b9e\u73b0\u957f\u671f\u76d1\u63a7\u3002<\/p>\n<h2>&#x1f680;\u56db\u3001\u914d\u7f6ecrontab<\/h2>\n<p>\u8fd9\u4e9b\u811a\u672c\u5199\u597d\u4e86&#xff0c;\u9700\u8981\u5b9a\u65f6\u6267\u884c&#xff0c;\u53ef\u4ee5\u901a\u8fc7crontab\u914d\u7f6e\u6bcf\u5929\u6216\u8005\u51e0\u4e2a\u5c0f\u65f6\u8dd1\u4e00\u6b21\u3002\u4e0b\u9762\u662f\u6bcf8\u5c0f\u65f6\u8dd1\u4e00\u6b21\u7684\u914d\u7f6e\u3002<\/p>\n<p>* *\/8 * * * <span class=\"token function\">bash<\/span> \/\u4f60\u7684\u4ee3\u7801\u57fa\u7840\u8def\u5f84\/disk.sh<\/p>\n<h2>&#x1f680;\u4e94\u3001\u603b\u7ed3<\/h2>\n<p>\u670d\u52a1\u5668\u7684CPU\u3001\u78c1\u76d8\u548c\u5185\u5b58\u662f\u670d\u52a1\u5668\u8fd0\u884c\u548c\u5904\u7406\u4efb\u52a1\u7684\u5173\u952e\u7ec4\u4ef6&#xff0c;\u5b83\u4eec\u7684\u6b63\u5e38\u8fd0\u884c\u72b6\u6001\u5bf9\u670d\u52a1\u5668\u7684\u7a33\u5b9a\u6027\u548c\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u56e0\u6b64&#xff0c;\u76d1\u63a7\u670d\u52a1\u5668\u7684CPU\u3001\u78c1\u76d8\u548c\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u662f\u975e\u5e38\u5fc5\u8981\u7684\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418182703-68029977c4255.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9&#xff0c;\u6211\u4eec\u4e0b\u6b21\u89c1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.8k\u6b21\uff0c\u70b9\u8d5e81\u6b21\uff0c\u6536\u85cf168\u6b21\u3002CPU\u3001\u5185\u5b58\u548c\u78c1\u76d8\u662f\u8ba1\u7b97\u673a\u4e2d\u91cd\u8981\u4e14\u76f8\u4e92\u4f9d\u8d56\u7684\u7ec4\u4ef6\u3002CPU\u6267\u884c\u8fd0\u7b97\u548c\u63a7\u5236\u6307\u4ee4\uff0c\u5185\u5b58\u63d0\u4f9b\u4e34\u65f6\u5b58\u50a8\u7a7a\u95f4\u7528\u4e8e\u5b58\u50a8CPU\u9700\u8981\u5904\u7406\u7684\u6570\u636e\u548c\u6307\u4ee4\uff0c\u800c\u78c1\u76d8\u5219\u63d0\u4f9b\u957f\u671f\u5b58\u50a8\u7684\u529f\u80fd\u3002\u5b83\u4eec\u5171\u540c\u5de5\u4f5c\u4ee5\u5b9e\u73b0\u8ba1\u7b97\u673a\u7684\u6b63\u5e38\u8fd0\u884c\u548c\u6570\u636e\u5904\u7406\u4efb\u52a1\u3002\u672c\u6587\u4e3b\u8981\u901a\u8fc7shell\u5b9e\u73b0\u5982\u4f55\u76d1\u63a7\u4ed6\u4eec\u7684\u4f7f\u7528\u60c5\u51b5\u3002\u670d\u52a1\u5668\u7684CPU\u78c1\u76d8\u548c\u5185\u5b58\u662f\u670d\u52a1\u5668\u8fd0\u884c\u548c\u5904\u7406\u4efb\u52a1\u7684\u5173\u952e\u7ec4\u4ef6\uff0c\u5b83\u4eec\u7684\u6b63\u5e38\u8fd0\u884c\u72b6\u6001\u5bf9\u670d\u52a1\u5668\u7684\u7a33\u5b9a\u6027\u548c\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u56e0\u6b64\uff0c\u76d1\u63a7\u670d\u52a1\u5668\u7684CPU\u78c1\u76d8\u548c\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u662f\u975e\u5e38\u5fc5\u8981\u7684\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u6211\u4eec\u4e0b\u6b21\u89c1\u3002_java\u6267\u884c\u76d1\u63a7cpu\u3001\u5185\u5b58\u78c1\u76d8\u7684shell\u547d\u4ee4\u5f71\u54cdcpu\u6027\u80fd\u5417<\/p>\n","protected":false},"author":2,"featured_media":19917,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,1468,43,770,1543,44],"topic":[],"class_list":["post-19923","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-shell","tag-43","tag-770","tag-1543","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/19923.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.8k\u6b21\uff0c\u70b9\u8d5e81\u6b21\uff0c\u6536\u85cf168\u6b21\u3002CPU\u3001\u5185\u5b58\u548c\u78c1\u76d8\u662f\u8ba1\u7b97\u673a\u4e2d\u91cd\u8981\u4e14\u76f8\u4e92\u4f9d\u8d56\u7684\u7ec4\u4ef6\u3002CPU\u6267\u884c\u8fd0\u7b97\u548c\u63a7\u5236\u6307\u4ee4\uff0c\u5185\u5b58\u63d0\u4f9b\u4e34\u65f6\u5b58\u50a8\u7a7a\u95f4\u7528\u4e8e\u5b58\u50a8CPU\u9700\u8981\u5904\u7406\u7684\u6570\u636e\u548c\u6307\u4ee4\uff0c\u800c\u78c1\u76d8\u5219\u63d0\u4f9b\u957f\u671f\u5b58\u50a8\u7684\u529f\u80fd\u3002\u5b83\u4eec\u5171\u540c\u5de5\u4f5c\u4ee5\u5b9e\u73b0\u8ba1\u7b97\u673a\u7684\u6b63\u5e38\u8fd0\u884c\u548c\u6570\u636e\u5904\u7406\u4efb\u52a1\u3002\u672c\u6587\u4e3b\u8981\u901a\u8fc7shell\u5b9e\u73b0\u5982\u4f55\u76d1\u63a7\u4ed6\u4eec\u7684\u4f7f\u7528\u60c5\u51b5\u3002\u670d\u52a1\u5668\u7684CPU\u78c1\u76d8\u548c\u5185\u5b58\u662f\u670d\u52a1\u5668\u8fd0\u884c\u548c\u5904\u7406\u4efb\u52a1\u7684\u5173\u952e\u7ec4\u4ef6\uff0c\u5b83\u4eec\u7684\u6b63\u5e38\u8fd0\u884c\u72b6\u6001\u5bf9\u670d\u52a1\u5668\u7684\u7a33\u5b9a\u6027\u548c\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u56e0\u6b64\uff0c\u76d1\u63a7\u670d\u52a1\u5668\u7684CPU\u78c1\u76d8\u548c\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u662f\u975e\u5e38\u5fc5\u8981\u7684\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u6211\u4eec\u4e0b\u6b21\u89c1\u3002_java\u6267\u884c\u76d1\u63a7cpu\u3001\u5185\u5b58\u78c1\u76d8\u7684shell\u547d\u4ee4\u5f71\u54cdcpu\u6027\u80fd\u5417\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/19923.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T18:27:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418182701-68029975d16ad.gif\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/19923.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/19923.html\",\"name\":\"Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T18:27:05+00:00\",\"dateModified\":\"2025-04-18T18:27:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/19923.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/19923.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/19923.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/19923.html","og_locale":"zh_CN","og_type":"article","og_title":"Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.8k\u6b21\uff0c\u70b9\u8d5e81\u6b21\uff0c\u6536\u85cf168\u6b21\u3002CPU\u3001\u5185\u5b58\u548c\u78c1\u76d8\u662f\u8ba1\u7b97\u673a\u4e2d\u91cd\u8981\u4e14\u76f8\u4e92\u4f9d\u8d56\u7684\u7ec4\u4ef6\u3002CPU\u6267\u884c\u8fd0\u7b97\u548c\u63a7\u5236\u6307\u4ee4\uff0c\u5185\u5b58\u63d0\u4f9b\u4e34\u65f6\u5b58\u50a8\u7a7a\u95f4\u7528\u4e8e\u5b58\u50a8CPU\u9700\u8981\u5904\u7406\u7684\u6570\u636e\u548c\u6307\u4ee4\uff0c\u800c\u78c1\u76d8\u5219\u63d0\u4f9b\u957f\u671f\u5b58\u50a8\u7684\u529f\u80fd\u3002\u5b83\u4eec\u5171\u540c\u5de5\u4f5c\u4ee5\u5b9e\u73b0\u8ba1\u7b97\u673a\u7684\u6b63\u5e38\u8fd0\u884c\u548c\u6570\u636e\u5904\u7406\u4efb\u52a1\u3002\u672c\u6587\u4e3b\u8981\u901a\u8fc7shell\u5b9e\u73b0\u5982\u4f55\u76d1\u63a7\u4ed6\u4eec\u7684\u4f7f\u7528\u60c5\u51b5\u3002\u670d\u52a1\u5668\u7684CPU\u78c1\u76d8\u548c\u5185\u5b58\u662f\u670d\u52a1\u5668\u8fd0\u884c\u548c\u5904\u7406\u4efb\u52a1\u7684\u5173\u952e\u7ec4\u4ef6\uff0c\u5b83\u4eec\u7684\u6b63\u5e38\u8fd0\u884c\u72b6\u6001\u5bf9\u670d\u52a1\u5668\u7684\u7a33\u5b9a\u6027\u548c\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u56e0\u6b64\uff0c\u76d1\u63a7\u670d\u52a1\u5668\u7684CPU\u78c1\u76d8\u548c\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u662f\u975e\u5e38\u5fc5\u8981\u7684\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u6211\u4eec\u4e0b\u6b21\u89c1\u3002_java\u6267\u884c\u76d1\u63a7cpu\u3001\u5185\u5b58\u78c1\u76d8\u7684shell\u547d\u4ee4\u5f71\u54cdcpu\u6027\u80fd\u5417","og_url":"https:\/\/www.wsisp.com\/helps\/19923.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T18:27:05+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418182701-68029975d16ad.gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/19923.html","url":"https:\/\/www.wsisp.com\/helps\/19923.html","name":"Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T18:27:05+00:00","dateModified":"2025-04-18T18:27:05+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/19923.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/19923.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/19923.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Shell\u5f00\u53d1\u5b9e\u8df5\uff1a\u670d\u52a1\u5668\u7684\u78c1\u76d8\u3001CPU\u3001\u5185\u5b58\u7684\u5360\u7528\u76d1\u63a7"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/19923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=19923"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/19923\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/19917"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=19923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=19923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=19923"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=19923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}