{"id":36490,"date":"2025-05-10T07:31:00","date_gmt":"2025-05-09T23:31:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/36490.html"},"modified":"2025-05-10T07:31:00","modified_gmt":"2025-05-09T23:31:00","slug":"%e5%b8%b8%e7%94%a8linux%e6%9f%a5%e7%9c%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%bf%9b%e7%a8%8b%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/36490.html","title":{"rendered":"\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4"},"content":{"rendered":"<h2>Linux\u670d\u52a1\u5668\u6b63\u5e38\u542f\u52a8\u540e&#xff0c;\u63d0\u4f9b\u670d\u52a1\u65f6\u4f1a\u8c03\u7528\u7a0b\u5e8f&#xff0c;\u5360\u7528\u8fdb\u7a0b\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u67e5\u770b\u7cfb\u7edf\u4e2d\u6709\u54ea\u4e9b\u8fdb\u7a0b\u5728\u88ab\u8c03\u7528<\/h2>\n<li>\n<h3>ps \u8fdb\u7a0b\u67e5\u770b\u547d\u4ee4<\/h3>\n<\/li>\n<p>ps \u547d\u4ee4\u6700\u5e38\u7528\u6765\u76d1\u63a7\u540e\u53f0\u8fdb\u7a0b\u7684\u5de5\u4f5c\u60c5\u51b5&#xff0c;\u56e0\u4e3a\u540e\u53f0\u8fdb\u7a0b\u662f\u4e0d\u548c\u5c4f\u5e55\u3001\u952e\u76d8\u8fd9\u4e9b\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u8fdb\u884c\u901a\u4fe1\u7684&#xff0c;\u6240\u4ee5\u5982\u679c\u9700\u8981\u68c0\u6d4b\u540e\u53f0\u60c5\u51b5&#xff0c;\u5c31\u9700\u8981\u4f7f\u7528 ps \u547d\u4ee4\u4e86\u3002\u5176\u4e3b\u8981\u9009\u9879\u5982\u4e0b&#xff1a;<\/p>\n<p>\u00a0\u00a0-a&#xff1a;\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u00a0\u00a0-e&#xff1a;\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u00a0\u00a0-f&#xff1a;\u663e\u793a\u8fdb\u7a0b\u7684\u6240\u6709\u4fe1\u606f\u3002<\/p>\n<p>\u00a0\u00a0-l&#xff1a;\u4ee5\u957f\u683c\u5f0f\u663e\u793a\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n<p>\u00a0\u00a0-r&#xff1a;\u53ea\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002<\/p>\n<p>\u00a0\u00a0-u&#xff1a;\u663e\u793a\u9762\u5411\u7528\u6237\u7684\u683c\u5f0f(\u5305\u62ec\u7528\u6237\u540d\u3001CPU \u53ca\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u7b49\u4fe1\u606f)\u3002<\/p>\n<p>\u00a0\u00a0-x&#xff1a;\u663e\u793a\u6240\u6709\u975e\u63a7\u5236\u7ec8\u7aef\u4e0a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n<p>\u00a0\u00a0-p&#xff1a;\u663e\u793a\u7531\u8fdb\u7a0b ID \u6307\u5b9a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n<p>\u00a0\u00a0-t&#xff1a;\u663e\u6307\u5b9a\u7ec8\u7aef\u4e0a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n<p>\u4e3a\u76d1\u6d4b\u548c\u63a7\u5236\u8fdb\u7a0b&#xff0c;\u9700\u5148\u4e86\u89e3\u5176\u5f53\u524d\u72b6\u6001&#xff0c;\u800c\u901a\u8fc7ps\u547d\u4ee4\u67e5\u770b\u8fdb\u7a0b&#xff0c;\u80fd\u83b7\u53d6\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001\u3001\u8fd0\u884c\u65f6\u957f\u3001\u5360\u7528\u8d44\u6e90\u3001\u4f18\u5148\u7ea7\u53ca\u6807\u5fd7\u53f7\u7b49\u4fe1\u606f&#xff0c;\u8fd9\u4e9b\u5bf9\u7528\u6237\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u90fd\u81f3\u5173\u91cd\u8981\u3002\u5176\u4e2d&#xff0c;ps -aux\u547d\u4ee4\u53ef\u83b7\u53d6\u7ec8\u7aef\u4e0a\u6240\u6709\u7528\u6237\u7684\u8fdb\u7a0b\u4fe1\u606f&#xff0c;\u662f\u6700\u5e38\u7528\u7684\u547d\u4ee4\u4e4b\u4e00\u3002<\/p>\n<h4>1.1 ps -aux<\/h4>\n<p>ps -aux \u4ee5\u7b80\u5355\u5217\u8868\u7684\u5f62\u5f0f\u663e\u793a\u51fa\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"472\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250509233059-681e9033270e3.png\" width=\"1377\" \/><\/p>\n<p>\u5176\u4e2d<\/p>\n<ul>\n<li>\n<p>USER&#xff1a;\u542f\u52a8\u8be5\u8fdb\u7a0b\u7684\u7528\u6237\u8d26\u53f7\u540d\u79f0<\/p>\n<\/li>\n<li>\n<p>PID&#xff08;Process ID&#xff09;&#xff1a;\u8fdb\u7a0b\u6807\u8bc6\u7b26&#xff0c;\u662f\u7cfb\u7edf\u4e3a\u6bcf\u4e2a\u8fdb\u7a0b\u5206\u914d\u7684\u552f\u4e00\u7f16\u53f7&#xff0c;\u7528\u4e8e\u6807\u8bc6\u8fdb\u7a0b<\/p>\n<\/li>\n<li>\n<p>%CPU&#xff1a;\u8fdb\u7a0b\u5360\u7528 CPU \u7684\u767e\u5206\u6bd4&#xff0c;\u53cd\u6620\u8fdb\u7a0b\u5bf9 CPU \u8d44\u6e90\u7684\u4f7f\u7528\u60c5\u51b5<\/p>\n<\/li>\n<li>\n<p>%MEM&#xff1a; \u8fdb\u7a0b\u5360\u7528\u7269\u7406\u5185\u5b58\u7684\u767e\u5206\u6bd4&#xff0c;\u4f53\u73b0\u8fdb\u7a0b\u5360\u7528\u5185\u5b58\u8d44\u6e90\u7684\u6bd4\u4f8b<\/p>\n<\/li>\n<li>\n<p>VSZ&#xff08;Virtual Set Size&#xff09;&#xff1a;\u5360\u7528\u865a\u62df\u5185\u5b58\u7684\u5927\u5c0f<\/p>\n<\/li>\n<li>\n<p>RSS&#xff08;Resident Set Size&#xff09;&#xff1a;\u5360\u7528\u5e38\u9a7b\u5185\u5b58&#xff08;\u7269\u7406\u5185\u5b58&#xff09;\u7684\u5927\u5c0f<\/p>\n<\/li>\n<li>\n<p>TTY&#xff1a;\u8be5\u8fdb\u7a0b\u5728\u54ea\u4e2a\u7ec8\u7aef\u4e0a\u8fd0\u884c\u3002\u201c&#xff1f;\u201d\u8868\u672a\u77e5\u6216\u4e0d\u9700\u8981\u7ec8\u7aef<\/p>\n<\/li>\n<li>\n<p>STAT&#xff1a;\u663e\u793a\u4e86\u8fdb\u7a0b\u5f53\u524d\u7684\u72b6\u6001&#xff0c;\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>\n<p>S&#xff1a; \u7761\u7720\u72b6\u6001&#xff08;\u53ef\u4e2d\u65ad\u7761\u7720 &#xff09;<\/p>\n<\/li>\n<li>\n<p>s&#xff1a; \u8868\u793a\u8be5\u8fdb\u7a0b\u662f\u4f1a\u8bdd\u9996\u8fdb\u7a0b &#xff0c;\u4e5f\u5c31\u662f\u7236\u8fdb\u7a0b<\/p>\n<\/li>\n<li>\n<p>I&#xff1a; \u7a7a\u95f2\u72b6\u6001<\/p>\n<\/li>\n<li>\n<p>&lt;&#xff1a; \u9ad8\u4f18\u5148\u7ea7\u8fdb\u7a0b<\/p>\n<\/li>\n<li>\n<p>N&#xff1a;\u4f4e\u4f18\u5148\u7ea7\u8fdb\u7a0b<\/p>\n<\/li>\n<li>\n<p>Z&#xff1a;\u50f5\u6b7b\u72b6\u6001&#xff08;\u5e94\u4e88\u4ee5\u624b\u52a8\u7ec8\u6b62&#xff09;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>START&#xff1a;\u542f\u52a8\u8be5\u8fdb\u7a0b\u7684\u65f6\u95f4&#xff0c;\u8bb0\u5f55\u8fdb\u7a0b\u5f00\u59cb\u8fd0\u884c\u7684\u65f6\u523b<\/p>\n<\/li>\n<li>\n<p>TIME&#xff1a;\u6307\u8fdb\u7a0b\u7d2f\u8ba1\u5360\u7528 CPU \u7684\u65f6\u95f4&#xff0c;\u7edf\u8ba1\u8be5\u8fdb\u7a0b\u81ea\u542f\u52a8\u4ee5\u6765\u4f7f\u7528 CPU \u7684\u65f6\u957f<\/p>\n<\/li>\n<li>\n<p>COMMAND&#xff08;Command&#xff09;&#xff1a;\u663e\u793a\u542f\u52a8\u8fdb\u7a0b\u6240\u6267\u884c\u7684\u547d\u4ee4\u6216\u7a0b\u5e8f\u540d &#xff0c;\u53ef\u5e2e\u52a9\u8bc6\u522b\u8fdb\u7a0b\u5177\u4f53\u5728\u6267\u884c\u4ec0\u4e48\u4efb\u52a1<\/p>\n<\/li>\n<\/ul>\n<h4>1.2 ps -ef<\/h4>\n<p>ps -ef\u67e5\u770b\u6240\u6709\u8fdb\u7a0b\u8be6\u7ec6\u4fe1\u606f\u7684\u547d\u4ee4<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"382\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250509233059-681e90335df6f.png\" width=\"1206\" \/><\/p>\n<ul>\n<li>\n<p>PPID (Parent Process ID) &#xff1a;\u7236\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u6807\u8bc6\u7b26 &#xff0c;\u901a\u8fc7\u5b83\u53ef\u4ee5\u4e86\u89e3\u8fdb\u7a0b\u95f4\u7684\u7236\u5b50\u5173\u7cfb<\/p>\n<\/li>\n<\/ul>\n<li>\n<h3>top \u5b9e\u65f6\u52a8\u6001\u76d1\u63a7\u8fdb\u7a0b<\/h3>\n<\/li>\n<p>\u76f4\u63a5\u5728\u7ec8\u7aef\u8f93\u5165top\u547d\u4ee4\u5e76\u56de\u8f66&#xff0c;\u5373\u53ef\u8fdb\u5165\u4ea4\u4e92\u5f0f\u754c\u9762&#xff0c;\u52a8\u6001\u663e\u793a\u7cfb\u7edf\u4e2d\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u53ca\u5176\u8d44\u6e90\u5360\u7528\u60c5\u51b5&#xff0c;\u6309q\u53ef\u9000\u51fa\u3002\u53ef\u663e\u793a\u8fdb\u7a0b\u6392\u540d&#xff0c;\u53ca\u65f6\u8ddf\u8e2a\u5305\u62ecCPU\u3001\u5185\u5b58\u7b49\u7cfb\u7edf\u8d44\u6e90\u5360\u7528\u60c5\u51b5&#xff0c;\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u6bcf\u4e09\u79d2\u5237\u65b0\u4e00\u6b21\u3002<\/p>\n<h4>2.1 \u5e38\u7528\u53c2\u6570&#xff1a;<\/h4>\n<ul>\n<li>\n<p>-u &#xff1a;\u540e\u8ddf\u7528\u6237\u540d&#xff0c;\u663e\u793a\u6307\u5b9a\u7528\u6237\u7684\u8fdb\u7a0b \u3002\u6bd4\u5982top -u root&#xff0c;\u663e\u793aroot\u7528\u6237\u542f\u52a8\u7684\u8fdb\u7a0b\u3002<\/p>\n<\/li>\n<li>\n<p>-p &#xff1a;\u540e\u8ddf\u8fdb\u7a0b PID&#xff0c;\u663e\u793a\u6307\u5b9a\u8fdb\u7a0b\u7684\u4fe1\u606f \u3002\u4f8b\u5982top -p 123 &#xff0c;\u53ea\u663e\u793a PID \u4e3a 123 \u7684\u8fdb\u7a0b\u60c5\u51b5\u3002<\/p>\n<\/li>\n<li>\n<p>-n &#xff1a;\u6307\u5b9a\u5237\u65b0\u6b21\u6570 \u3002\u5982top -n 5&#xff0c;\u8868\u793a\u5237\u65b0 5 \u6b21\u540e\u9000\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p>-d &#xff1a;\u6307\u5b9a\u5237\u65b0\u95f4\u9694\u65f6\u95f4&#xff08;\u79d2&#xff09; \u3002\u6bd4\u5982top -d 2&#xff0c;\u8bbe\u7f6e\u5237\u65b0\u95f4\u9694\u4e3a 2 \u79d2<\/p>\n<\/li>\n<\/ul>\n<h4>2.2 \u4ea4\u4e92\u64cd\u4f5c<\/h4>\n<ul>\n<li>\n<p>\u6392\u5e8f&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6309P &#xff0c;\u6839\u636e CPU \u4f7f\u7528\u7387\u5bf9\u8fdb\u7a0b\u6392\u5e8f \u3002<\/p>\n<\/li>\n<li>\n<p>\u6309M &#xff0c;\u4f9d\u636e\u5185\u5b58\u4f7f\u7528\u7387\u6392\u5e8f \u3002<\/p>\n<\/li>\n<li>\n<p>\u6309N &#xff0c;\u6309\u7167 PID \u6392\u5e8f \u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8fc7\u6ee4\u663e\u793a&#xff1a;\u6309u &#xff0c;\u8f93\u5165\u7528\u6237\u540d&#xff0c;\u53ef\u53ea\u663e\u793a\u8be5\u7528\u6237\u7684\u8fdb\u7a0b&#xff1b;\u6309o\u6216O &#xff0c;\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6392\u5e8f\u89c4\u5219\u3002<\/p>\n<\/li>\n<li>\n<p>\u7ed3\u675f\u8fdb\u7a0b&#xff1a;\u6309k &#xff0c;\u8f93\u5165\u8981\u7ed3\u675f\u8fdb\u7a0b\u7684 PID &#xff0c;\u518d\u6309\u56de\u8f66&#xff0c;\u53ef\u53d1\u9001\u4fe1\u53f7\u7ec8\u6b62\u8fdb\u7a0b&#xff08;\u4e00\u822c\u7528 15 \u4fe1\u53f7\u6b63\u5e38\u7ec8\u6b62&#xff0c;9 \u4fe1\u53f7\u5f3a\u5236\u7ec8\u6b62 &#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u6539\u53d8\u8fdb\u7a0b\u4f18\u5148\u7ea7&#xff1a;\u6309r &#xff0c;\u8f93\u5165\u8fdb\u7a0b PID &#xff0c;\u518d\u8f93\u5165\u65b0\u7684 nice \u503c&#xff0c;\u53ef\u8c03\u6574\u8fdb\u7a0b\u4f18\u5148\u7ea7 \u3002<\/p>\n<\/li>\n<li>\n<p>\u5207\u6362\u663e\u793a&#xff1a;\u6309\u6570\u5b571 &#xff0c;\u53ef\u76d1\u63a7\u6bcf\u4e2a\u903b\u8f91 CPU \u7684\u72b6\u51b5 &#xff1b;\u6309z &#xff0c;\u53ef\u9ad8\u4eae\u663e\u793a\u6d3b\u52a8\u8fdb\u7a0b \u3002<\/p>\n<\/li>\n<\/ul>\n<h4>2.3 \u8f93\u51fa\u5185\u5bb9\u89e3\u8bfb<\/h4>\n<p>\u8f93\u51fa\u5185\u5bb9\u4e3b\u8981\u6709\u4e24\u90e8\u5206&#xff0c;\u5206\u522b\u662f\u5934\u90e8\u4fe1\u606f\u548c\u8fdb\u7a0b\u5217\u8868<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"654\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250509233059-681e90338b115.png\" width=\"1142\" \/><\/p>\n<h5>2.3.1 Head\u5934\u90e8\u4fe1\u606f<\/h5>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u884c&#xff1a;\u7cfb\u7edf\u5f53\u524d\u65f6\u95f4\u3001\u7cfb\u7edf\u8fd0\u884c\u65f6\u957f\u3001\u5f53\u524d\u767b\u5f55\u7528\u6237\u6570\u3001\u7cfb\u7edf\u5e73\u5747\u8d1f\u8f7d&#xff08;1 \u5206\u949f\u30015 \u5206\u949f\u300115 \u5206\u949f &#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u884c&#xff1a;\u8fdb\u7a0b\u603b\u6570\u3001\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u6570\u3001\u7761\u7720\u7684\u8fdb\u7a0b\u6570\u3001\u505c\u6b62\u7684\u8fdb\u7a0b\u6570\u3001\u50f5\u5c38\u8fdb\u7a0b\u6570 \u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e09\u884c&#xff1a;CPU \u4f7f\u7528\u7387\u76f8\u5173\u6570\u636e&#xff0c;\u5305\u62ec\u7528\u6237\u7a7a\u95f4&#xff08;us &#xff09;\u3001\u5185\u6838\u7a7a\u95f4&#xff08;sy &#xff09;\u3001\u6539\u53d8\u8fc7\u4f18\u5148\u7ea7\u7684\u7528\u6237\u8fdb\u7a0b&#xff08;ni &#xff09;\u3001\u7a7a\u95f2&#xff08;id &#xff09;\u3001\u7b49\u5f85 I\/O&#xff08;wa &#xff09;\u3001\u786c\u4e2d\u65ad&#xff08;hi &#xff09;\u3001\u8f6f\u4e2d\u65ad&#xff08;si &#xff09;\u3001\u865a\u62df\u673a\u7b49\u5f85 CPU&#xff08;st &#xff09;\u7b49\u7684\u5360\u6bd4 \u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u56db\u884c&#xff1a;\u7269\u7406\u5185\u5b58\u603b\u91cf\u3001\u5df2\u4f7f\u7528\u5185\u5b58\u91cf\u3001\u7a7a\u95f2\u5185\u5b58\u91cf\u3001\u7528\u4f5c\u5185\u6838\u7f13\u5b58\u7684\u5185\u5b58\u91cf \u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e94\u884c&#xff1a;\u4ea4\u6362\u5206\u533a\u603b\u91cf\u3001\u5df2\u4f7f\u7528\u4ea4\u6362\u533a\u91cf\u3001\u7a7a\u95f2\u4ea4\u6362\u533a\u91cf\u3001\u7f13\u51b2\u7684\u4ea4\u6362\u533a\u91cf \u3002<\/p>\n<\/li>\n<\/ul>\n<h5>2.3.2 \u8fdb\u7a0b\u5217\u8868<\/h5>\n<ul>\n<li>\n<p>PID&#xff1a;\u8fdb\u7a0b ID \u3002<\/p>\n<\/li>\n<li>\n<p>USER&#xff1a;\u8fdb\u7a0b\u6240\u6709\u8005\u7528\u6237\u540d \u3002<\/p>\n<\/li>\n<li>\n<p>PR&#xff1a;\u8fdb\u7a0b\u4f18\u5148\u7ea7 \u3002<\/p>\n<\/li>\n<li>\n<p>NI&#xff1a;\u8fdb\u7a0b\u7684 nice \u503c&#xff0c;\u8d1f\u503c\u8868\u793a\u9ad8\u4f18\u5148\u7ea7&#xff0c;\u6b63\u503c\u8868\u793a\u4f4e\u4f18\u5148\u7ea7 \u3002<\/p>\n<\/li>\n<li>\n<p>VIRT&#xff1a;\u8fdb\u7a0b\u4f7f\u7528\u7684\u865a\u62df\u5185\u5b58\u603b\u91cf \u3002<\/p>\n<\/li>\n<li>\n<p>RES&#xff1a;\u8fdb\u7a0b\u4f7f\u7528\u7684\u3001\u672a\u88ab\u6362\u51fa\u7684\u7269\u7406\u5185\u5b58\u5927\u5c0f \u3002<\/p>\n<\/li>\n<li>\n<p>SHR&#xff1a;\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u5185\u5b58\u91cf \u3002<\/p>\n<\/li>\n<li>\n<p>S&#xff1a;\u8fdb\u7a0b\u72b6\u6001&#xff08;R \u8fd0\u884c\u3001S \u7761\u7720\u3001D \u4e0d\u53ef\u4e2d\u65ad\u7761\u7720\u3001T \u8ddf\u8e2a \/ \u505c\u6b62\u3001Z \u50f5\u5c38\u8fdb\u7a0b &#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>%CPU&#xff1a;\u8fdb\u7a0b\u81ea\u4e0a\u6b21\u66f4\u65b0\u5230\u73b0\u5728\u7684 CPU \u65f6\u95f4\u5360\u7528\u767e\u5206\u6bd4 \u3002<\/p>\n<\/li>\n<li>\n<p>%MEM&#xff1a;\u8fdb\u7a0b\u4f7f\u7528\u7684\u7269\u7406\u5185\u5b58\u767e\u5206\u6bd4 \u3002<\/p>\n<\/li>\n<li>\n<p>TIME&#043;&#xff1a;\u8fdb\u7a0b\u521b\u5efa\u540e\u81f3\u4eca\u5360\u7528\u7684 CPU \u65f6\u95f4\u957f\u5ea6&#xff08;\u5355\u4f4d 1\/100 \u79d2 &#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>COMMAND&#xff1a;\u8fdb\u7a0b\u542f\u52a8\u7684\u547d\u4ee4\u540d\u6216\u547d\u4ee4\u884c \u3002<\/p>\n<\/li>\n<\/ul>\n<li>\n<h3>pstree \u6811\u5f62\u7ed3\u6784\u5c55\u793a\u8fdb\u7a0b\u5173\u7cfb<\/h3>\n<\/li>\n<p>pstree\u662f Linux \u7cfb\u7edf\u4e2d\u7528\u4e8e\u4ee5\u6811\u72b6\u7ed3\u6784\u5c55\u793a\u8fdb\u7a0b\u5173\u7cfb\u7684\u547d\u4ee4 &#xff0c;\u65b9\u4fbf\u76f4\u89c2\u5448\u73b0\u8fdb\u7a0b\u95f4\u7236\u5b50\u5c42\u7ea7\u5173\u8054\u3002\u7cfb\u7edf\u7ba1\u7406\u5458\u53ef\u5229\u7528pstree\u6574\u4f53\u4e86\u89e3\u7cfb\u7edf\u4e2d\u8fdb\u7a0b\u7684\u7ec4\u7ec7\u67b6\u6784\u548c\u8fd0\u884c\u5c42\u6b21&#xff0c;\u638c\u63e1\u8fdb\u7a0b\u95f4\u4f9d\u8d56\u5173\u7cfb\u7b49&#xff0c;\u4fbf\u4e8e\u65e5\u5e38\u7cfb\u7edf\u7ba1\u7406\u548c\u7ef4\u62a4<\/p>\n<h4>3.1 \u5e38\u7528\u53c2\u6570&#xff1a;<\/h4>\n<ul>\n<li>\n<p>-p&#xff1a;\u53ef\u5728\u6811\u72b6\u56fe\u4e2d\u663e\u793a\u6bcf\u4e2a\u8fdb\u7a0b\u7684 PID<\/p>\n<\/li>\n<li>\n<p>-u&#xff1a;\u5c55\u793a\u8fdb\u7a0b\u7684\u6240\u5c5e\u7528\u6237<\/p>\n<\/li>\n<li>\n<p>-a&#xff1a;\u663e\u793a\u542f\u52a8\u6bcf\u4e2a\u8fdb\u7a0b\u5bf9\u5e94\u7684\u6307\u4ee4\u3001\u53c2\u6570\u7b49<\/p>\n<\/li>\n<li>\n<p>-n&#xff1a;\u4f7f\u8f93\u51fa\u7ed3\u679c\u6839\u636e\u8fdb\u7a0b PID \u53f7\u6765\u6392\u5e8f&#xff0c;\u9ed8\u8ba4\u662f\u4ee5\u7a0b\u5e8f\u540d\u6392\u5e8f<\/p>\n<\/li>\n<li>\n<p>-h&#xff08;\u5c0f\u5199&#xff09;\u7528\u4e8e\u9ad8\u4eae\u5f53\u524d\u8fdb\u7a0b\u53ca\u5176\u7956\u5148&#xff1b;<\/p>\n<\/li>\n<li>\n<p>-H&#xff08;\u5927\u5199&#xff09;\u540e\u8ddf PID &#xff0c;\u53ef\u9ad8\u4eae\u6307\u5b9a PID \u7684\u8fdb\u7a0b<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb837\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf11\u6b21\u3002ps \u547d\u4ee4\u6700\u5e38\u7528\u6765\u76d1\u63a7\u540e\u53f0\u8fdb\u7a0b\u7684\u5de5\u4f5c\u60c5\u51b5\uff0c\u56e0\u4e3a\u540e\u53f0\u8fdb\u7a0b\u662f\u4e0d\u548c\u5c4f\u5e55\u3001\u952e\u76d8\u8fd9\u4e9b\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u8fdb\u884c\u901a\u4fe1\u7684\uff0c\u6240\u4ee5\u5982\u679c\u9700\u8981\u68c0\u6d4b\u540e\u53f0\u60c5\u51b5\uff0c\u5c31\u9700\u8981\u4f7f\u7528 ps \u547d\u4ee4\u4e86\u3002\u5176\u4e3b\u8981\u9009\u9879\u5982\u4e0b\uff1a-a\uff1a\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002-e\uff1a\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002-f\uff1a\u663e\u793a\u8fdb\u7a0b\u7684\u6240\u6709\u4fe1\u606f\u3002-l\uff1a\u4ee5\u957f\u683c\u5f0f\u663e\u793a\u8fdb\u7a0b\u4fe1\u606f\u3002-r\uff1a\u53ea\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002-u\uff1a\u663e\u793a\u9762\u5411\u7528\u6237\u7684\u683c\u5f0f(\u5305\u62ec\u7528\u6237\u540d\u3001CPU \u53ca\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u7b49\u4fe1\u606f)\u3002-x\uff1a\u663e\u793a\u6240\u6709\u975e\u63a7\u5236\u7ec8\u7aef\u4e0a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002-p\uff1a\u663e\u793a\u7531\u8fdb\u7a0b ID \u6307\u5b9a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002-t\uff1a\u663e\u6307\u5b9a\u7ec8\u7aef\u4e0a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n","protected":false},"author":2,"featured_media":36487,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-36490","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4 - \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\/36490.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb837\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf11\u6b21\u3002ps \u547d\u4ee4\u6700\u5e38\u7528\u6765\u76d1\u63a7\u540e\u53f0\u8fdb\u7a0b\u7684\u5de5\u4f5c\u60c5\u51b5\uff0c\u56e0\u4e3a\u540e\u53f0\u8fdb\u7a0b\u662f\u4e0d\u548c\u5c4f\u5e55\u3001\u952e\u76d8\u8fd9\u4e9b\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u8fdb\u884c\u901a\u4fe1\u7684\uff0c\u6240\u4ee5\u5982\u679c\u9700\u8981\u68c0\u6d4b\u540e\u53f0\u60c5\u51b5\uff0c\u5c31\u9700\u8981\u4f7f\u7528 ps \u547d\u4ee4\u4e86\u3002\u5176\u4e3b\u8981\u9009\u9879\u5982\u4e0b\uff1a-a\uff1a\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002-e\uff1a\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002-f\uff1a\u663e\u793a\u8fdb\u7a0b\u7684\u6240\u6709\u4fe1\u606f\u3002-l\uff1a\u4ee5\u957f\u683c\u5f0f\u663e\u793a\u8fdb\u7a0b\u4fe1\u606f\u3002-r\uff1a\u53ea\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002-u\uff1a\u663e\u793a\u9762\u5411\u7528\u6237\u7684\u683c\u5f0f(\u5305\u62ec\u7528\u6237\u540d\u3001CPU \u53ca\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u7b49\u4fe1\u606f)\u3002-x\uff1a\u663e\u793a\u6240\u6709\u975e\u63a7\u5236\u7ec8\u7aef\u4e0a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002-p\uff1a\u663e\u793a\u7531\u8fdb\u7a0b ID \u6307\u5b9a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002-t\uff1a\u663e\u6307\u5b9a\u7ec8\u7aef\u4e0a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/36490.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-09T23:31:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250509233059-681e9033270e3.png\" \/>\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\/36490.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/36490.html\",\"name\":\"\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-09T23:31:00+00:00\",\"dateModified\":\"2025-05-09T23:31:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/36490.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/36490.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36490.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4\"}]},{\"@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":"\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4 - \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\/36490.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb837\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf11\u6b21\u3002ps \u547d\u4ee4\u6700\u5e38\u7528\u6765\u76d1\u63a7\u540e\u53f0\u8fdb\u7a0b\u7684\u5de5\u4f5c\u60c5\u51b5\uff0c\u56e0\u4e3a\u540e\u53f0\u8fdb\u7a0b\u662f\u4e0d\u548c\u5c4f\u5e55\u3001\u952e\u76d8\u8fd9\u4e9b\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u8fdb\u884c\u901a\u4fe1\u7684\uff0c\u6240\u4ee5\u5982\u679c\u9700\u8981\u68c0\u6d4b\u540e\u53f0\u60c5\u51b5\uff0c\u5c31\u9700\u8981\u4f7f\u7528 ps \u547d\u4ee4\u4e86\u3002\u5176\u4e3b\u8981\u9009\u9879\u5982\u4e0b\uff1a-a\uff1a\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002-e\uff1a\u663e\u793a\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u3002-f\uff1a\u663e\u793a\u8fdb\u7a0b\u7684\u6240\u6709\u4fe1\u606f\u3002-l\uff1a\u4ee5\u957f\u683c\u5f0f\u663e\u793a\u8fdb\u7a0b\u4fe1\u606f\u3002-r\uff1a\u53ea\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002-u\uff1a\u663e\u793a\u9762\u5411\u7528\u6237\u7684\u683c\u5f0f(\u5305\u62ec\u7528\u6237\u540d\u3001CPU \u53ca\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u7b49\u4fe1\u606f)\u3002-x\uff1a\u663e\u793a\u6240\u6709\u975e\u63a7\u5236\u7ec8\u7aef\u4e0a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002-p\uff1a\u663e\u793a\u7531\u8fdb\u7a0b ID \u6307\u5b9a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002-t\uff1a\u663e\u6307\u5b9a\u7ec8\u7aef\u4e0a\u7684\u8fdb\u7a0b\u4fe1\u606f\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/36490.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-09T23:31:00+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250509233059-681e9033270e3.png"}],"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\/36490.html","url":"https:\/\/www.wsisp.com\/helps\/36490.html","name":"\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-09T23:31:00+00:00","dateModified":"2025-05-09T23:31:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/36490.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/36490.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/36490.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5e38\u7528Linux\u67e5\u770b\u670d\u52a1\u5668\u8fdb\u7a0b\u547d\u4ee4"}]},{"@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\/36490","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=36490"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36490\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/36487"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=36490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=36490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=36490"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=36490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}