{"id":701,"date":"2020-03-09T16:32:14","date_gmt":"2020-03-09T08:32:14","guid":{"rendered":"http:\/\/h2.wjxy.net.cn:8081\/?p=701"},"modified":"2023-10-04T06:32:57","modified_gmt":"2023-10-03T22:32:57","slug":"ps-aux%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wjxy.net.cn\/?p=701","title":{"rendered":"ps -aux\u547d\u4ee4\u8be6\u89e3"},"content":{"rendered":"<h1 class=\"postTitle\"><a id=\"cb_post_title_url\" class=\"postTitle2\" href=\"https:\/\/www.cnblogs.com\/dion-90\/articles\/9048627.html\">ps -aux\u547d\u4ee4\u8be6\u89e3<\/a><\/h1>\n<div class=\"clear\"><\/div>\n<div class=\"postBody\">\n<div id=\"cnblogs_post_body\" class=\"blogpost-body \">\n<p>https:\/\/blog.csdn.net\/x_i_y_u_e\/article\/details\/48463623<\/p>\n<p>&nbsp;<\/p>\n<div><a class=\"keylink\" href=\"http:\/\/www.2cto.com\/os\/linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">Linux<\/a>\u00a0ps aux\u6307\u4ee4\u8a73\u89e3<\/div>\n<div><\/div>\n<div>linux\u4e0a\u8fdb\u7a0b\u67095\u79cd\u72b6\u6001:<\/div>\n<div>1. \u8fd0\u884c(\u6b63\u5728\u8fd0\u884c\u6216\u5728\u8fd0\u884c\u961f\u5217\u4e2d\u7b49\u5f85)<\/div>\n<div>2. \u4e2d\u65ad(\u4f11\u7720\u4e2d, \u53d7\u963b, \u5728\u7b49\u5f85\u67d0\u4e2a\u6761\u4ef6\u7684\u5f62\u6210\u6216\u63a5\u53d7\u5230\u4fe1\u53f7)<\/div>\n<div>3. \u4e0d\u53ef\u4e2d\u65ad(\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)<\/div>\n<div>4. \u50f5\u6b7b(\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)<\/div>\n<div>5. \u505c\u6b62(\u8fdb\u7a0b\u6536\u5230SIGSTOP, SIGSTP, SIGTIN, SIGTOU\u4fe1\u53f7\u540e\u505c\u6b62\u8fd0\u884c\u8fd0\u884c)<\/div>\n<div><\/div>\n<div>1\uff09ps a \u663e\u793a\u73b0\u884c\u7ec8\u7aef\u673a\u4e0b\u7684\u6240\u6709\u7a0b\u5e8f\uff0c\u5305\u62ec\u5176\u4ed6\u7528\u6237\u7684\u7a0b\u5e8f\u3002<\/div>\n<div>2\uff09ps -A \u663e\u793a\u6240\u6709\u7a0b\u5e8f\u3002<\/div>\n<div>3\uff09ps c \u5217\u51fa\u7a0b\u5e8f\u65f6\uff0c\u663e\u793a\u6bcf\u4e2a\u7a0b\u5e8f\u771f\u6b63\u7684\u6307\u4ee4\u540d\u79f0\uff0c\u800c\u4e0d\u5305\u542b\u8def\u5f84\uff0c\u53c2\u6570\u6216\u5e38\u9a7b\u670d\u52a1\u7684\u6807\u793a\u3002<\/div>\n<div>4\uff09ps -e \u6b64\u53c2\u6570\u7684\u6548\u679c\u548c\u6307\u5b9a&#8221;A&#8221;\u53c2\u6570\u76f8\u540c\u3002<\/div>\n<div>5\uff09ps e \u5217\u51fa\u7a0b\u5e8f\u65f6\uff0c\u663e\u793a\u6bcf\u4e2a\u7a0b\u5e8f\u6240\u4f7f\u7528\u7684\u73af\u5883\u53d8\u91cf\u3002<\/div>\n<div>6\uff09ps f \u7528ASCII\u5b57\u7b26\u663e\u793a\u6811\u72b6\u7ed3\u6784\uff0c\u8868\u8fbe\u7a0b\u5e8f\u95f4\u7684\u76f8\u4e92\u5173\u7cfb\u3002<\/div>\n<div>7\uff09ps -H \u663e\u793a\u6811\u72b6\u7ed3\u6784\uff0c\u8868\u793a\u7a0b\u5e8f\u95f4\u7684\u76f8\u4e92\u5173\u7cfb\u3002<\/div>\n<div>8\uff09ps -N \u663e\u793a\u6240\u6709\u7684\u7a0b\u5e8f\uff0c\u9664\u4e86\u6267\u884cps\u6307\u4ee4\u7ec8\u7aef\u673a\u4e0b\u7684\u7a0b\u5e8f\u4e4b\u5916\u3002<\/div>\n<div>9\uff09ps s \u91c7\u7528\u7a0b\u5e8f\u4fe1\u53f7\u7684\u683c\u5f0f\u663e\u793a\u7a0b\u5e8f\u72b6\u51b5\u3002<\/div>\n<div>10\uff09ps S \u5217\u51fa\u7a0b\u5e8f\u65f6\uff0c\u5305\u62ec\u5df2\u4e2d\u65ad\u7684\u5b50\u7a0b\u5e8f\u8d44\u6599\u3002<\/div>\n<div>11\uff09ps -t &lt;\u7ec8\u7aef\u673a\u7f16\u53f7&gt; \u3000\u6307\u5b9a\u7ec8\u7aef\u673a\u7f16\u53f7\uff0c\u5e76\u5217\u51fa\u5c5e\u4e8e\u8be5\u7ec8\u7aef\u673a\u7684\u7a0b\u5e8f\u7684\u72b6\u51b5\u3002<\/div>\n<div>12\uff09ps u \u3000 \u4ee5\u7528\u6237\u4e3a\u4e3b\u7684\u683c\u5f0f\u6765\u663e\u793a\u7a0b\u5e8f\u72b6\u51b5\u3002<\/div>\n<div>13\uff09ps x \u3000 \u663e\u793a\u6240\u6709\u7a0b\u5e8f\uff0c\u4e0d\u4ee5\u7ec8\u7aef\u673a\u6765\u533a\u5206\u3002<\/div>\n<div>14\uff09ps -l \u8f03\u9577,\u8f03\u8a73\u7d30\u7684\u986f\u793a\u8a72PID\u7684\u4fe1\u606f<\/div>\n<div><\/div>\n<div># ps -lA |more<\/div>\n<div>F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD<\/div>\n<div>4 S 0 1 0 0 76 0 &#8211; 1193 109952 ? 00:00:03 init<\/div>\n<div>1 S 0 2 1 0 -40 &#8211; &#8211; 0 migrat ? 00:00:03 migration\/0<\/div>\n<div>1 S 0 3 1 0 94 19 &#8211; 0 ksofti ? 00:00:00 ksoftirqd\/0<\/div>\n<div>1 S 0 4 1 0 -40 &#8211; &#8211; 0 migrat ? 00:00:02 migration\/1<\/div>\n<div>1 S 0 5 1 0 94 19 &#8211; 0 ksofti ? 00:00:00 ksoftirqd\/1<\/div>\n<div>1 S 0 6 1 0 -40 &#8211; &#8211; 0 migrat ? 00:00:02 migration\/2<\/div>\n<div>1 S 0 7 1 0 94 19 &#8211; 0 ksofti ? 00:00:00 ksoftirqd\/2<\/div>\n<div><\/div>\n<div>\u76f8\u95dc\u4fe1\u606f\u7684\u610f\u7fa9\uff1a<\/div>\n<div>F \u9032\u7a0b\u7684\u6a19\u8a8c\uff08flag\uff09\uff0c4\u8868\u793a\u7528\u6236\u70ba\u8d85\u7d1a\u7528\u6236<\/div>\n<div>S \u9032\u7a0b\u7684\u72c0\u614b\uff08stat\uff09\uff0c\u5404STAT\u7684\u610f\u7fa9\u898b\u4e0b\u6587<\/div>\n<div>PID \u9032\u7a0b\u7684ID<\/div>\n<div>C CPU\u4f7f\u7528\u8cc7\u6e90\u7684\u767e\u5206\u6bd4<\/div>\n<div>PRI priority(\u512a\u5148\u7d1a)\u7684\u7e2e\u5beb\uff0c<\/div>\n<div>NI Nice\u503c\uff0c<\/div>\n<div>ADDR \u6838\u5fc3\u529f\u80fd\uff0c\u6307\u51fa\u8a72\u9032\u7a0b\u5728\u5167\u5b58\u7684\u90a3\u4e00\u90e8\u5206\uff0c\u5982\u679c\u662f\u904b\u884c\u7684\u9032\u7a0b\uff0c\u4e00\u822c\u90fd\u662f\u201c-\u201d<\/div>\n<div>SZ \u7528\u6389\u7684\u5167\u5b58\u7684\u5927\u5c0f<\/div>\n<div>WCHAN \u7576\u524d\u9032\u7a0b\u662f\u5426\u6b63\u5728\u904b\u884c\uff0c\u82e5\u70ba\u201c-\u201d\u8868\u793a\u6b63\u5728\u904b\u884c<\/div>\n<div>TTY \u767b\u9678\u8005\u7684\u7d42\u7aef\u4f4d\u7f6e<\/div>\n<div>TIME \u7528\u6389\u7684CPU\u7684\u6642\u9593<\/div>\n<div>CMD \u6240\u57f7\u884c\u7684\u6307\u4ee4<\/div>\n<div><\/div>\n<div># ps aux |more<\/div>\n<div>USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND<\/div>\n<div>root 1 0.0 0.0 4772 564 ? S Sep22 0:03 init [3]<\/div>\n<div>root 2 0.0 0.0 0 0 ? S Sep22 0:03 [migration\/0]<\/div>\n<div>root 3 0.0 0.0 0 0 ? SN Sep22 0:00 [ksoftirqd\/0]<\/div>\n<div>root 4 0.0 0.0 0 0 ? S Sep22 0:02 [migration\/1]<\/div>\n<div>root 5 0.0 0.0 0 0 ? SN Sep22 0:00 [ksoftirqd\/1]<\/div>\n<div>root 6 0.0 0.0 0 0 ? Ss+ Sep22 0:02 [migration\/2]<\/div>\n<div>root 7 0.0 0.0 0 0 ? SN Sep22 0:00 [ksoftirqd\/2]<\/div>\n<div>root 8 0.0 0.0 0 0 ? S Sep22 0:00 [migration\/3]<\/div>\n<div>root 9 0.0 0.0 0 0 ? SN Sep22 0:00 [ksoftirqd\/3]<\/div>\n<div>root 10 0.0 0.0 0 0 ? S&lt; Sep22 0:00 [migration\/4]<\/div>\n<div>\u4e0a\u8ff0\u5404\u4f4d\u89e3\u91ca\uff1a<\/div>\n<div>USER \u8fdb\u7a0b\u7684\u5c5e\u4e3b\uff1b<\/div>\n<div>PID \u8fdb\u7a0b\u7684ID\uff1b<\/div>\n<div>PPID \u7236\u8fdb\u7a0b\uff1b<\/div>\n<div>%CPU \u8fdb\u7a0b\u5360\u7528\u7684CPU\u767e\u5206\u6bd4\uff1b<\/div>\n<div>%MEM \u5360\u7528\u5185\u5b58\u7684\u767e\u5206\u6bd4\uff1b<\/div>\n<div>NI \u8fdb\u7a0b\u7684NICE\u503c\uff0c\u6570\u503c\u5927\uff0c\u8868\u793a\u8f83\u5c11\u5360\u7528CPU\u65f6\u95f4\uff1b<\/div>\n<div>VSZ \u8fdb\u7a0b\u4f7f\u7528\u7684\u865a\u62df\u5167\u5b58\u91cf\uff08KB\uff09\uff1b<\/div>\n<div>RSS \u8be5\u8fdb\u7a0b\u5360\u7528\u7684\u56fa\u5b9a\u5167\u5b58\u91cf\uff08KB\uff09\uff08\u9a7b\u7559\u4e2d\u9875\u7684\u6570\u91cf\uff09\uff1b<\/div>\n<div>TTY \u8be5\u8fdb\u7a0b\u5728\u90a3\u500b\u7d42\u7aef\u4e0a\u904b\u884c\uff08\u767b\u9678\u8005\u7684\u7d42\u7aef\u4f4d\u7f6e\uff09\uff0c\u82e5\u8207\u7d42\u7aef\u7121\u95dc\uff0c\u5247\u986f\u793a\uff08\uff1f\uff09\u3002<br \/>\n\u82e5\u4e3apts\/0\u7b49\uff0c\u5219\u8868\u793a\u7531\u7f51\u7edc\u8fde\u63a5\u4e3b\u673a\u8fdb\u7a0b<\/div>\n<div>WCHAN \u5f53\u524d\u8fdb\u7a0b\u662f\u5426\u6b63\u5728\u9032\u884c\uff0c\u82e5\u4e3a-\u8868\u793a\u6b63\u5728\u9032\u884c\uff1b<\/div>\n<div>START \u8a72\u9032\u7a0b\u88ab\u89f8\u767c\u542f\u52a8\u65f6\u95f4\uff1b<\/div>\n<div>TIME \u8a72\u8fdb\u7a0b\u5be6\u969b\u4f7f\u7528CPU\u904b\u884c\u7684\u65f6\u95f4\uff1b<\/div>\n<div>COMMAND \u547d\u4ee4\u7684\u540d\u79f0\u548c\u53c2\u6570\uff1b<\/div>\n<div>STAT\u72c0\u614b\u4f4d\u5e38\u898b\u7684\u72c0\u614b\u5b57\u7b26<\/div>\n<div>D \u65e0\u6cd5\u4e2d\u65ad\u7684\u4f11\u7720\u72b6\u6001\uff08\u901a\u5e38 IO \u7684\u8fdb\u7a0b\uff09\uff1b<\/div>\n<div>R \u6b63\u5728\u8fd0\u884c\u53ef\u4e2d\u5728\u961f\u5217\u4e2d\u53ef\u8fc7\u884c\u7684\uff1b<\/div>\n<div>S \u5904\u4e8e\u4f11\u7720\u72b6\u6001\uff1b<\/div>\n<div>T \u505c\u6b62\u6216\u88ab\u8ffd\u8e2a\uff1b<\/div>\n<div>W \u8fdb\u5165\u5185\u5b58\u4ea4\u6362 \uff08\u4ece\u5185\u68382.6\u5f00\u59cb\u65e0\u6548\uff09\uff1b<\/div>\n<div>X \u6b7b\u6389\u7684\u8fdb\u7a0b \uff08\u57fa\u672c\u5f88\u5c11\u898b\uff09\uff1b<\/div>\n<div>Z \u50f5\u5c38\u8fdb\u7a0b\uff1b<\/div>\n<div>&lt; \u4f18\u5148\u7ea7\u9ad8\u7684\u8fdb\u7a0b<\/div>\n<div>N \u4f18\u5148\u7ea7\u8f83\u4f4e\u7684\u8fdb\u7a0b<\/div>\n<div>L \u6709\u4e9b\u9875\u88ab\u9501\u8fdb\u5185\u5b58\uff1b<\/div>\n<div>s \u8fdb\u7a0b\u7684\u9886\u5bfc\u8005\uff08\u5728\u5b83\u4e4b\u4e0b\u6709\u5b50\u8fdb\u7a0b\uff09\uff1b<\/div>\n<div>l \u591a\u8fdb\u7a0b\u7684\uff08\u4f7f\u7528 CLONE_THREAD, \u7c7b\u4f3c NPTL pthreads\uff09\uff1b<\/div>\n<div>+ \u4f4d\u4e8e\u540e\u53f0\u7684\u8fdb\u7a0b\u7ec4\uff1b<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ps -aux\u547d\u4ee4\u8be6\u89e3 https:\/\/blog.csdn.net\/x_i_y_u_e\/article\/det [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/701"}],"collection":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=701"}],"version-history":[{"count":1,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/701\/revisions"}],"predecessor-version":[{"id":702,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/701\/revisions\/702"}],"wp:attachment":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}