{"id":16,"date":"2020-12-11T16:30:37","date_gmt":"2020-12-11T08:30:37","guid":{"rendered":"http:\/\/zoran.090702.xyz\/?p=16"},"modified":"2020-12-11T16:30:37","modified_gmt":"2020-12-11T08:30:37","slug":"linux%e4%b8%ad%e6%9f%a5%e7%9c%8b%e8%bf%9b%e7%a8%8b%e7%8a%b6%e6%80%81%e4%bf%a1%e6%81%af","status":"publish","type":"post","link":"https:\/\/zoran.090702.xyz\/?p=16","title":{"rendered":"Linux\u4e2d\u67e5\u770b\u8fdb\u7a0b\u72b6\u6001\u4fe1\u606f"},"content":{"rendered":"<p><strong>\u4e00\u3001\u5e38\u7528\u547d\u4ee4\u603b\u7ed3\u00a0<\/strong><\/p>\n<p>ps -l\u00a0 \u00a0\u5217\u51fa\u4e0e\u672c\u6b21\u767b\u5f55\u6709\u5173\u7684\u8fdb\u7a0b\u4fe1\u606f\uff1b<br \/>\nps -aux\u00a0 \u00a0\u67e5\u8be2\u5185\u5b58\u4e2d\u8fdb\u7a0b\u4fe1\u606f\uff1b<br \/>\nps -aux | grep ***\u00a0 \u00a0\u67e5\u8be2***\u8fdb\u7a0b\u7684\u8be6\u7ec6\u4fe1\u606f\uff1b<br \/>\ntop\u00a0 \u00a0\u67e5\u770b\u5185\u5b58\u4e2d\u8fdb\u7a0b\u7684\u52a8\u6001\u4fe1\u606f\uff1b<br \/>\nkill -9 pid\u00a0 \u00a0\u6740\u6b7b\u8fdb\u7a0b\u3002<\/p>\n<p>(\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\uff0c\u8bf7\u79fb\u6b65\u6211\u7684<a href=\"https:\/\/www.meijindong.top\/posts\/2679121756.html\">\u4e2a\u4eba\u535a\u5ba2<\/a>)<\/p>\n<p><strong>\u4e8c\u3001\u8fdb\u7a0b\u7b80\u8ff0\u53ca\u67e5\u770b\u65b9\u5f0f<\/strong><\/p>\n<p>\u8fdb\u7a0b\u662f\u8fd0\u884c\u7684\u7a0b\u5e8f\u5728\u7cfb\u7edf\u4e2d\u7684\u5b58\u5728\u5f62\u5f0f\uff0c\u901a\u8fc7\u67e5\u770b\u8fdb\u7a0b\u7684\u72b6\u6001\u4fe1\u606f\uff0c\u6211\u4eec\u53ef\u4ee5\u4e86\u89e3\u8fdb\u7a0b\u5360\u7528\u7684\u7cfb\u7edf\u8d44\u6e90\u60c5\u51b5\uff0c\u5bf9\u7cfb\u7edf\u7684\u8fd0\u884c\u72b6\u6001\u8fdb\u884c\u5206\u6790\u3001\u8c03\u6574\uff0c\u4ece\u800c\u8ba9\u7cfb\u7edf\u4fdd\u6301\u5728\u4e00\u4e2a\u5e73\u7a33\u7684\u72b6\u6001\u4e0b\u8fd0\u884c\u3002<\/p>\n<p>Linux\u4e2d\u67e5\u770b\u8fdb\u7a0b\u4fe1\u606f\u7684\u57fa\u672c\u547d\u4ee4\u6709ps\u3001top\uff0c\u5176\u4e2dps(Process Status)\u67e5\u770b\u7684\u662f\u8fdb\u7a0b\u4fe1\u606f\u7684\u4e00\u4e2a\u5feb\u7167\uff0c\u663e\u793a\u7684\u6211\u4eec\u6267\u884cps\u8fd9\u4e2a\u547d\u4ee4\u65f6\u8fdb\u7a0b\u7684\u4fe1\u606f\uff0ctop\u663e\u793a\u7684\u662f\u8fdb\u7a0b\u7684\u52a8\u6001\u4fe1\u606f\uff0c\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u770b\u5230\u8fdb\u7a0b\u4fe1\u606f\u7684\u52a8\u6001\u53d8\u5316\u3002<\/p>\n<p><strong>\u4e09\u3001\u8fdb\u7a0b\u4fe1\u606f\u7684\u67e5\u770b<\/strong><\/p>\n<p><strong>3.1\u00a0 \u5217\u51fa\u4e0e\u00a0\u672c\u6b21\u767b\u5f55\u7cfb\u7edf \u6709\u5173\u7684\u8fdb\u7a0b\u4fe1\u606f<\/strong><br \/>\nps\u00a0 ( ps -l, \u5217\u51fa\u7684\u662f\u8be6\u7ec6\u4fe1\u606f )<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"has\" src=\"https:\/\/img-blog.csdn.net\/20181024211748428?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI0NzU0MDYx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\" width=\"683\" height=\"84\" \/><\/p>\n<p>F\u00a0\u4ee3\u8868\u8fd9\u4e2a\u7a0b\u5e8f\u7684\u65d7\u6807 (flag)\uff0c 4 \u4ee3\u8868\u4f7f\u7528\u8005\u4e3a superuser\uff1b<br \/>\nS\u00a0\u4ee3\u8868\u8fd9\u4e2a\u7a0b\u5e8f\u7684\u72b6\u6001 (STAT)\uff1b<br \/>\n\uff08\u00a0 \u5e38\u89c1\u7684\u8fdb\u7a0b\u7684 STAT \u5982\u4e0b\uff1a<br \/>\nR\u00a0\u8fd0\u884c Runnable (on run queue) \u6b63\u5728\u8fd0\u884c\u6216\u5728\u8fd0\u884c\u961f\u5217\u4e2d\u7b49\u5f85\uff0c<br \/>\nS\u00a0\u7761\u7720 Sleeping \u4f11\u7720\u4e2d, \u53d7\u963b, \u5728\u7b49\u5f85\u67d0\u4e2a\u6761\u4ef6\u7684\u5f62\u6210\u6216\u63a5\u53d7\u5230\u4fe1\u53f7\uff0c<br \/>\nI\u00a0\u00a0\u7a7a\u95f2 Idle \uff0c<br \/>\nZ \u50f5\u6b7b Zombie\uff08a defunct process) \u8fdb\u7a0b\u5df2\u7ec8\u6b62, \u4f46\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u5b58\u5728, \u76f4\u5230\u7236\u8fdb\u7a0b\u8c03\u7528wait4()\u7cfb\u7edf\u8c03\u7528\u540e\u91ca\u653e\uff0c<br \/>\nD \u4e0d\u53ef\u4e2d\u65ad Uninterruptible sleep (ususally IO) \u6536\u5230\u4fe1\u53f7\u4e0d\u5524\u9192\u548c\u4e0d\u53ef\u8fd0\u884c, \u8fdb\u7a0b\u5fc5\u987b\u7b49\u5f85\u76f4\u5230\u6709\u4e2d\u65ad\u53d1\u751f\uff0c<br \/>\nT \u7ec8\u6b62 Terminate \u8fdb\u7a0b\u6536\u5230SIGSTOP, SIGSTP, SIGTIN, SIGTOU\u4fe1\u53f7\u540e\u505c\u6b62\u8fd0\u884c\u8fd0\u884c\uff0c<br \/>\nP \u7b49\u5f85\u4ea4\u6362\u9875 \uff0c<br \/>\nW \u65e0\u9a7b\u7559\u9875 has no resident pages \u6ca1\u6709\u8db3\u591f\u7684\u8bb0\u5fc6\u4f53\u5206\u9875\u53ef\u5206\u914d\uff0c<br \/>\nX \u6b7b\u6389\u7684\u8fdb\u7a0b \uff0c<br \/>\n&lt; \u9ad8\u4f18\u5148\u7ea7\u8fdb\u7a0b \u9ad8\u4f18\u5148\u5e8f\u7684\u8fdb\u7a0b \uff0c<br \/>\nN \u4f4e\u4f18\u5148 \u7ea7\u8fdb\u7a0b \u4f4e\u4f18\u5148\u5e8f\u7684\u8fdb\u7a0b \uff0c<br \/>\nL \u5185\u5b58\u9501\u9875 Lock \u6709\u8bb0\u5fc6\u4f53\u5206\u9875\u5206\u914d\u5e76\u7f29\u5728\u8bb0\u5fc6\u4f53\u5185 \uff0c<br \/>\ns \u8fdb\u7a0b\u7684\u9886\u5bfc\u8005\uff08\u5728\u5b83\u4e4b\u4e0b\u6709\u5b50\u8fdb\u7a0b\uff09\uff0c<br \/>\nl \u591a\u8fdb\u7a0b\u7684\uff08\u4f7f\u7528 CLONE_THREAD, \u7c7b\u4f3c NPTL pthreads\uff09\u3002 \uff09<\/p>\n<p><strong>3.2\u00a0 \u5217\u51fa\u5728\u5185\u5b58\u4e2d\u8fd0\u884c\u7684\u00a0 \u5168\u90e8\u8fdb\u7a0b\u4fe1\u606f<\/strong><br \/>\nps\u00a0 -aux ( ps -aux | grep ***,\u00a0 \u5217\u51fa *** \u8fdb\u7a0b\u7684\u8be6\u7ec6\u4fe1\u606f)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"has\" src=\"https:\/\/img-blog.csdn.net\/20181024212703348?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI0NzU0MDYx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\" width=\"741\" height=\"191\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"has\" src=\"https:\/\/img-blog.csdn.net\/20181024213110272?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI0NzU0MDYx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\" width=\"1082\" height=\"155\" \/><\/p>\n<p>USER \uff1a\u8fdb\u7a0b\u7684\u6240\u5c5e\u7528\u6237\uff0c<br \/>\nPID \uff1a\u8fdb\u7a0b\u7684\u8fdb\u7a0bID\u53f7\uff0c<br \/>\n%CPU \uff1a\u8fdb\u7a0b\u5360\u7528\u7684 CPU\u8d44\u6e90 \u767e\u5206\u6bd4\uff0c<br \/>\n%MEM \uff1a\u8fdb\u7a0b\u5360\u7528\u7684 \u7269\u7406\u5185\u5b58 \u767e\u5206\u6bd4\uff0c<br \/>\nVSZ \uff1a\u8fdb\u7a0b\u4f7f\u7528\u6389\u7684\u865a\u62df\u5185\u5b58\u91cf (Kbytes) \uff0c<br \/>\nRSS \uff1a\u8fdb\u7a0b\u5360\u7528\u7684\u56fa\u5b9a\u7684\u5185\u5b58\u91cf (Kbytes) \uff0c<br \/>\nTTY \uff1a\u4e0e\u8fdb\u7a0b\u76f8\u5173\u8054\u7684\u7ec8\u7aef\uff08tty),?\u4ee3\u8868\u65e0\u5173,tty1-tty6\u662f\u672c\u673a\u4e0a\u9762\u7684\u767b\u5165\u8005\u7a0b\u5e8f,pts\/0\u8868\u793a\u4e3a\u7531\u7f51\u7edc\u8fde\u63a5\u8fdb\u4e3b\u673a\u7684\u7a0b\u5e8f\u3002<br \/>\nSTAT \uff1a\u8fdb\u7a0b\u7684\u72b6\u6001\uff0c\u5177\u4f53\u89c12.1\u5217\u51fa\u6765\u7684\u90e8\u5206\u00a0\uff0c<br \/>\nSTART \uff1a\u8fdb\u7a0b\u5f00\u59cb\u521b\u5efa\u7684\u65f6\u95f4 \uff0c<br \/>\nTIME \uff1a\u8fdb\u7a0b\u4f7f\u7528\u7684\u603bcpu\u65f6\u95f4\uff0c<br \/>\nCOMMAND : \u8fdb\u7a0b\u5bf9\u5e94\u7684\u5b9e\u9645\u7a0b\u5e8f\u3002<\/p>\n<p>3.3\u00a0\u00a0\u52a8\u6001\u663e\u793a\u5185\u5b58\u4e2d\u7684\u8fdb\u7a0b\u4fe1\u606f\uff08top\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"has\" src=\"https:\/\/img-blog.csdn.net\/20181024215547689?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI0NzU0MDYx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\" width=\"759\" height=\"313\" \/><\/p>\n<p><strong>\u56db\u3001\u8fdb\u7a0b\u7684\u6e05\u9664<\/strong><\/p>\n<p>kill -9 -pid \uff08pid\u901a\u8fc7\u4e0a\u9762\u7684\u547d\u4ee4\u53ef\u4ee5\u67e5\u5230\uff09<\/p>\n<p>\u6ce8\uff1a\u6709\u4e9b\u8fdb\u7a0b\u662f\u4e0d\u5141\u8bb8\u505c\u6b62\u7684\uff0c\u56e0\u4e3a\u505c\u6b62\u4f1a\u9020\u6210\u7cfb\u7edf\u7684\u4e0d\u7a33\u5b9a\uff0c\u751a\u81f3\u5d29\u6e83\u3002\uff08\u7f51\u4e0a\u641c\u7d22\u8fdb\u7a0b\u77e5\u8bc6\u4e86\u89e3\u66f4\u591a\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5e38\u7528\u547d\u4ee4\u603b\u7ed3\u00a0 ps -l\u00a0 \u00a0\u5217\u51fa\u4e0e\u672c\u6b21\u767b\u5f55\u6709\u5173\u7684\u8fdb\u7a0b\u4fe1\u606f\uff1b ps -aux\u00a0 \u00a0\u67e5\u8be2\u5185\u5b58\u4e2d\u8fdb\u7a0b\u4fe1\u606f\uff1b &hellip; <a href=\"https:\/\/zoran.090702.xyz\/?p=16\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">Linux\u4e2d\u67e5\u770b\u8fdb\u7a0b\u72b6\u6001\u4fe1\u606f<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[4],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-2","tag-4"],"_links":{"self":[{"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16"}],"version-history":[{"count":1,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zoran.090702.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}