{"id":63921,"date":"2025-04-29T11:12:24","date_gmt":"2025-04-29T03:12:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63921\/"},"modified":"2025-04-29T11:12:24","modified_gmt":"2025-04-29T03:12:24","slug":"linux%e6%80%8e%e4%b9%88%e6%9f%a5%e7%9c%8b%e8%bf%90%e8%a1%8c%e7%9a%84%e8%bf%9b%e7%a8%8b-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63921\/","title":{"rendered":"linux\u600e\u4e48\u67e5\u770b\u8fd0\u884c\u7684\u8fdb\u7a0b"},"content":{"rendered":"<blockquote><p>\n  \u5728 linux \u4e2d\u67e5\u770b\u8fd0\u884c\u8fdb\u7a0b\u7684\u65b9\u6cd5\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a\u547d\u4ee4\u884c\u65b9\u6cd5\uff1aps\u3001top\u3001pgrep\u56fe\u5f62\u5316\u754c\u9762\u65b9\u6cd5\uff1a\u7cfb\u7edf\u76d1\u89c6\u5668\u3001\u4efb\u52a1\u7ba1\u7406\u5668\/proc \u76ee\u5f55\uff1a\u5305\u542b\u6709\u5173\u6bcf\u4e2a\u6b63\u5728\u8fd0\u884c\u8fdb\u7a0b\u7684\u4fe1\u606f\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/20\/2024082018223767732.jpg\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u67e5\u770b\u8fd0\u884c\u7684\u8fdb\u7a0b\u63d2\u56fe\" alt=\"linux\u600e\u4e48\u67e5\u770b\u8fd0\u884c\u7684\u8fdb\u7a0b\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5728 Linux \u4e2d\u67e5\u770b\u8fd0\u884c\u8fdb\u7a0b\u7684\u65b9\u6cd5<\/strong><\/p>\n<p><strong>\u547d\u4ee4\u884c\u65b9\u6cd5<\/strong><\/p>\n<ul>\n<li>\n<p><strong>ps \u547d\u4ee4\uff1a<\/strong><\/p>\n<ul>\n<li>ps aux\uff1a\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u8fdb\u7a0b\u6240\u6709\u8005\u3001\u547d\u4ee4\u3001\u72b6\u6001\u548c CPU \u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n<li>ps -ef\uff1a\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u5b8c\u6574\u4fe1\u606f\uff0c\u5305\u62ec\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<li>ps -l\uff1a\u4ee5\u957f\u683c\u5f0f\u663e\u793a\u8fdb\u7a0b\u4fe1\u606f\uff0c\u63d0\u4f9b\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>top \u547d\u4ee4\uff1a<\/strong><\/p>\n<ul>\n<li>top\uff1a\u5b9e\u65f6\u663e\u793a\u7cfb\u7edf\u4e2d\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\uff0c\u4ee5\u53ca\u5b83\u4eec\u4f7f\u7528\u7684 CPU\u3001\u5185\u5b58\u548c\u5176\u4ed6\u8d44\u6e90\u3002<\/li>\n<li>\u53ef\u901a\u8fc7\u6309 h \u952e\u67e5\u770b\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>pgrep \u547d\u4ee4\uff1a<\/strong><\/p>\n<ul>\n<li>pgrep procname\uff1a\u641c\u7d22\u5e76\u663e\u793a\u6307\u5b9a\u8fdb\u7a0b\u540d\u7684\u8fdb\u7a0b ID\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>\u56fe\u5f62\u5316\u754c\u9762\u65b9\u6cd5<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\u7cfb\u7edf\u76d1\u89c6\u5668\uff1a<\/strong><\/p>\n<ul>\n<li>\u8f6c\u5230\u5e94\u7528\u7a0b\u5e8f -&gt; \u7cfb\u7edf\u5de5\u5177 -&gt; \u7cfb\u7edf\u76d1\u89c6\u5668\u3002<\/li>\n<li>\u5728\u201c\u8fdb\u7a0b\u201d\u9009\u9879\u5361\u4e0b\uff0c\u53ef\u4ee5\u770b\u5230\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u5217\u8868\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4efb\u52a1\u7ba1\u7406\u5668\uff1a<\/strong><\/p>\n<ul>\n<li>\u6309\u4f4f Ctrl + Alt + Del \u952e\u3002<\/li>\n<li>\u9009\u62e9\u201c\u4efb\u52a1\u7ba1\u7406\u5668\u201d\u3002<\/li>\n<li>\u5728\u201c\u8fdb\u7a0b\u201d\u9009\u9879\u5361\u4e0b\uff0c\u53ef\u4ee5\u770b\u5230\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u5217\u8868\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u65b9\u6cd5<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\/proc \u76ee\u5f55\uff1a<\/strong><\/p>\n<ul>\n<li>\/proc \u76ee\u5f55\u5305\u542b\u4e86\u5173\u4e8e\u6bcf\u4e2a\u6b63\u5728\u8fd0\u884c\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002<\/li>\n<li>\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u6709\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u540d\u79f0\u662f\u8fdb\u7a0b ID\u3002<\/li>\n<li>\u53ef\u4ee5\u4f7f\u7528 cat \u547d\u4ee4\u67e5\u770b\u8fd9\u4e9b\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u4ee5\u83b7\u53d6\u6709\u5173\u8fdb\u7a0b\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u67e5\u770b\u5728 Linux \u7cfb\u7edf\u4e2d\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u67e5\u770b\u8fd0\u884c\u7684\u8fdb\u7a0b\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>\u5728 linux \u4e2d\u67e5\u770b\u8fd0\u884c\u8fdb\u7a0b\u7684\u65b9\u6cd5\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a\u547d\u4ee4\u884c\u65b9\u6cd5\uff1aps\u3001top\u3001pgrep\u56fe\u5f62\u5316\u754c\u9762\u65b9\u6cd5\uff1a\u7cfb\u7edf\u76d1\u89c6\u5668\u3001\u4efb\u52a1\u7ba1\u7406\u5668\/proc \u76ee\u5f55\uff1a\u5305\u542b\u6709\u5173\u6bcf\u4e2a\u6b63\u5728\u8fd0\u884c\u8fdb\u7a0b\u7684\u4fe1\u606f \u5728 Linux \u4e2d\u67e5\u770b\u8fd0\u884c\u8fdb\u7a0b\u7684\u65b9\u6cd5 \u547d\u4ee4\u884c\u65b9\u6cd5 ps \u547d\u4ee4\uff1a ps aux\uff1a\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u8fdb\u7a0b\u6240\u6709\u8005\u3001\u547d\u4ee4\u3001\u72b6\u6001\u548c CPU \u4f7f\u7528\u60c5\u51b5\u3002 ps -ef\uff1a\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u5b8c\u6574\u4fe1\u606f\uff0c\u5305\u62ec\u73af\u5883\u53d8\u91cf\u3002 ps -l\uff1a\u4ee5\u957f\u683c\u5f0f\u663e\u793a\u8fdb\u7a0b\u4fe1\u606f\uff0c\u63d0\u4f9b\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002 top \u547d\u4ee4\uff1a top\uff1a\u5b9e\u65f6\u663e\u793a\u7cfb\u7edf\u4e2d\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\uff0c\u4ee5\u53ca\u5b83\u4eec\u4f7f\u7528\u7684 CPU\u3001\u5185\u5b58\u548c\u5176\u4ed6\u8d44\u6e90\u3002 \u53ef\u901a\u8fc7\u6309 h \u952e\u67e5\u770b\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f\u3002 pgrep \u547d\u4ee4\uff1a pgrep procname\uff1a\u641c\u7d22\u5e76\u663e\u793a\u6307\u5b9a\u8fdb\u7a0b\u540d\u7684\u8fdb\u7a0b ID\u3002 \u56fe\u5f62\u5316\u754c\u9762\u65b9\u6cd5 \u7cfb\u7edf\u76d1\u89c6\u5668\uff1a \u8f6c\u5230\u5e94\u7528\u7a0b\u5e8f -&gt; \u7cfb\u7edf\u5de5\u5177 -&gt; \u7cfb\u7edf\u76d1\u89c6\u5668\u3002 \u5728\u201c\u8fdb\u7a0b\u201d\u9009\u9879\u5361\u4e0b\uff0c\u53ef\u4ee5\u770b\u5230\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u5217\u8868\u3002 \u4efb\u52a1\u7ba1\u7406\u5668\uff1a \u6309\u4f4f Ctrl + Alt + Del \u952e\u3002 \u9009\u62e9\u201c\u4efb\u52a1\u7ba1\u7406\u5668\u201d\u3002 \u5728\u201c\u8fdb\u7a0b\u201d\u9009\u9879\u5361\u4e0b\uff0c\u53ef\u4ee5\u770b\u5230\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u5217\u8868\u3002 \u5176\u4ed6\u65b9\u6cd5 \/proc \u76ee\u5f55\uff1a \/proc \u76ee\u5f55\u5305\u542b\u4e86\u5173\u4e8e\u6bcf\u4e2a\u6b63\u5728\u8fd0\u884c\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002 \u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u6709\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u540d\u79f0\u662f\u8fdb\u7a0b ID\u3002 [&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-63921","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63921","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=63921"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63921\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}