{"id":117063,"date":"2026-10-22T13:24:41","date_gmt":"2026-10-22T05:24:41","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/117063.html"},"modified":"2026-10-22T13:24:41","modified_gmt":"2026-10-22T05:24:41","slug":"07-%c2%b7-linux-%e8%bf%9b%e7%a8%8b%e4%b8%8e%e7%ab%af%e5%8f%a3%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/117063.html","title":{"rendered":"07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406"},"content":{"rendered":"<h2>07 \u00b7 \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406<\/h2>\n<p>\u4e00\u53e5\u8bdd\u5b9a\u4f4d&#xff1a;\u5224\u65ad\u201c\u6211\u7684\u670d\u52a1\u8fd8\u6d3b\u7740\u5417\u201d\u201c\u7aef\u53e3\u88ab\u8c01\u5360\u4e86\u201d\u201c\u600e\u4e48\u6740\u6389\u5361\u6b7b\u7684\u8fdb\u7a0b\u201d\u3002<\/p>\n<hr \/>\n<h3>1. \u67e5\u8fdb\u7a0b&#xff1a;ps<\/h3>\n<p><span class=\"token comment\"># \u6700\u5e38\u7528\u7ec4\u5408&#xff1a;\u67e5\u6240\u6709\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-ef<\/span>              <span class=\"token comment\"># \u5168\u683c\u5f0f\u5217\u51fa\u6240\u6709\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">ps<\/span> aux              <span class=\"token comment\"># \u53e6\u4e00\u79cd\u98ce\u683c&#xff08;\u5e26CPU\/\u5185\u5b58\u5360\u7528&#xff09;<\/span><\/p>\n<p><span class=\"token comment\"># \u2605\u5b9e\u6218&#xff1a;\u67e5\u81ea\u5df1\u7684 Java \u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-ef<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token function\">java<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-ef<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> app.jar<\/p>\n<p><span class=\"token comment\"># \u8f93\u51fa\u89e3\u8bfb&#xff08;ps -ef&#xff09;<\/span><br \/>\n<span class=\"token comment\"># UID   PID   PPID  C  STIME  TTY   TIME     CMD<\/span><br \/>\n<span class=\"token comment\"># root  12345 1     0  10:30  ?     00:01:23 java -jar app.jar<\/span><br \/>\n<span class=\"token comment\">#       \u2514\u2500\u8fdb\u7a0bID&#xff08;kill \u8981\u7528\u5b83&#xff09;        \u2514\u2500\u542f\u52a8\u547d\u4ee4<\/span><\/p>\n<hr \/>\n<h3>2. Java \u4e13\u5c5e&#xff1a;jps \/ jstack \/ jmap<\/h3>\n<p>JDK \u81ea\u5e26\u7684\u795e\u5668&#xff08;\u6bd4 ps \u66f4\u61c2 Java&#xff09;&#xff1a;<\/p>\n<p>jps                 <span class=\"token comment\"># \u5217\u51fa\u6240\u6709 Java \u8fdb\u7a0b&#xff08;\u53ea\u663e\u793a PID &#043; \u4e3b\u7c7b&#xff09;<\/span><br \/>\njps <span class=\"token parameter variable\">-l<\/span>              <span class=\"token comment\"># \u663e\u793a\u5b8c\u6574\u5305\u540d\/jar\u8def\u5f84<\/span><br \/>\njps <span class=\"token parameter variable\">-v<\/span>              <span class=\"token comment\"># \u663e\u793a JVM \u542f\u52a8\u53c2\u6570<\/span><\/p>\n<p><span class=\"token comment\"># \u6392\u67e5 CPU \u9ad8 \/ \u5361\u6b7b&#xff1a;\u6253\u5370\u7ebf\u7a0b\u6808<\/span><br \/>\njstack <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span> <span class=\"token operator\">&gt;<\/span> thread.txt      <span class=\"token comment\"># \u5bfc\u51fa\u6240\u6709\u7ebf\u7a0b\u5806\u6808<\/span><br \/>\njstack <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-A<\/span> <span class=\"token number\">20<\/span> <span class=\"token string\">&#034;BLOCKED&#034;<\/span>   <span class=\"token comment\"># \u770b\u963b\u585e\u7684\u7ebf\u7a0b<\/span><\/p>\n<p><span class=\"token comment\"># \u6392\u67e5\u5185\u5b58&#xff1a;\u770b\u5806\u5185\u5b58<\/span><br \/>\njmap <span class=\"token parameter variable\">-heap<\/span> <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span>               <span class=\"token comment\"># \u5806\u5185\u5b58\u6982\u51b5<\/span><br \/>\njmap <span class=\"token parameter variable\">-histo<\/span> <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">head<\/span> <span class=\"token parameter variable\">-20<\/span>   <span class=\"token comment\"># \u5bf9\u8c61\u6570\u91cf Top20&#xff08;\u67e5\u5185\u5b58\u6cc4\u6f0f&#xff09;<\/span><br \/>\njmap <span class=\"token parameter variable\">-dump:format<\/span><span class=\"token operator\">&#061;<\/span>b,file<span class=\"token operator\">&#061;<\/span>heap.hprof <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span>   <span class=\"token comment\"># \u5bfc\u51fa\u5806\u5feb\u7167&#xff08;\u7528 MAT \u5206\u6790&#xff09;<\/span><\/p>\n<p>\u8fd9\u4e9b\u662f Java \u7a0b\u5e8f\u5458\u6392\u67e5\u7ebf\u4e0a\u95ee\u9898\u7684\u770b\u5bb6\u672c\u9886&#xff0c;\u8be6\u7ec6\u7528\u6cd5\u89c1 15 \u7bc7\u6545\u969c\u6392\u67e5\u3002<\/p>\n<hr \/>\n<h3>3. \u5b9e\u65f6\u76d1\u63a7\u8fdb\u7a0b&#xff1a;top<\/h3>\n<p><span class=\"token function\">top<\/span>                 <span class=\"token comment\"># \u5b9e\u65f6\u8fdb\u7a0b\u5217\u8868&#xff08;\u7c7b\u4f3c\u4efb\u52a1\u7ba1\u7406\u5668&#xff09;<\/span><\/p>\n<p>top \u754c\u9762\u64cd\u4f5c&#xff1a;<\/p>\n<table>\n<tr>\u6309\u952e\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>P<\/td>\n<td>\u6309 CPU \u4f7f\u7528\u7387\u6392\u5e8f&#xff08;\u9ed8\u8ba4&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>M<\/td>\n<td>\u6309\u5185\u5b58\u4f7f\u7528\u7387\u6392\u5e8f<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>\u5c55\u5f00\u663e\u793a\u6bcf\u4e2a CPU \u6838\u5fc3<\/td>\n<\/tr>\n<tr>\n<td>k<\/td>\n<td>\u8f93\u5165 PID \u6740\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>q<\/td>\n<td>\u9000\u51fa<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span class=\"token comment\"># \u53ea\u770b\u67d0\u4e2a\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">top<\/span> <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">12345<\/span><\/p>\n<p><span class=\"token comment\"># \u66f4\u597d\u7528\u7684\u66ff\u4ee3\u54c1&#xff08;\u9700\u5b89\u88c5&#xff09;&#xff1a;htop&#xff0c;\u5f69\u8272\u3001\u53ef\u9f20\u6807\u64cd\u4f5c<\/span><br \/>\n<span class=\"token function\">htop<\/span><\/p>\n<hr \/>\n<h3>4. \u6740\u8fdb\u7a0b&#xff1a;kill<\/h3>\n<p><span class=\"token function\">kill<\/span> <span class=\"token number\">12345<\/span>          <span class=\"token comment\"># \u6e29\u67d4\u5730\u8bf7\u6c42\u7ed3\u675f&#xff08;\u53d1 SIGTERM&#xff0c;\u5e94\u7528\u80fd\u4f18\u96c5\u505c\u673a&#xff09;<\/span><br \/>\n<span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span> <span class=\"token number\">12345<\/span>       <span class=\"token comment\"># \u5f3a\u5236\u6740\u6b7b&#xff08;SIGKILL&#xff0c;\u6700\u540e\u624b\u6bb5&#xff0c;\u4e0d\u7ed9\u6e05\u7406\u673a\u4f1a&#xff09;<\/span><br \/>\n<span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-15<\/span> <span class=\"token number\">12345<\/span>      <span class=\"token comment\"># &#061; kill 12345&#xff0c;\u63a8\u8350\u4f18\u5148\u7528<\/span><\/p>\n<p><span class=\"token comment\"># \u2605\u4e00\u952e\u6740\u6389\u67d0\u4e2a Java \u5e94\u7528<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-ef<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> app.jar <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-v<\/span> <span class=\"token function\">grep<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $2}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">xargs<\/span> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span><\/p>\n<p><span class=\"token comment\"># \u6309\u540d\u5b57\u6740&#xff08;\u8c28\u614e&#xff0c;\u4f1a\u6740\u6389\u6240\u6709\u5339\u914d\u7684&#xff09;<\/span><br \/>\n<span class=\"token function\">pkill<\/span> <span class=\"token parameter variable\">-f<\/span> app.jar<br \/>\n<span class=\"token function\">killall<\/span> <span class=\"token function\">java<\/span>        <span class=\"token comment\"># \u6740\u6240\u6709 java \u8fdb\u7a0b&#xff08;\u26a0\ufe0f\u614e\u7528&#xff09;<\/span><\/p>\n<p>\u4f18\u5148 kill&#xff08;15&#xff09; \u8ba9 Spring Boot \u6267\u884c &#064;PreDestroy\/\u4f18\u96c5\u505c\u673a&#xff1b;\u5b9e\u5728\u6740\u4e0d\u6389\u518d kill -9\u3002<\/p>\n<hr \/>\n<h3>5. \u67e5\u7aef\u53e3\u5360\u7528&#xff08;\u90e8\u7f72\u5fc5\u5907&#xff09;<\/h3>\n<p>\u201c\u7aef\u53e3 8080 \u88ab\u5360\u7528&#xff0c;\u542f\u52a8\u5931\u8d25\u201d&#xff1a;<\/p>\n<p><span class=\"token comment\"># ss&#xff08;\u65b0&#xff0c;\u63a8\u8350&#xff0c;\u5feb&#xff09;<\/span><br \/>\nss <span class=\"token parameter variable\">-tlnp<\/span>                   <span class=\"token comment\"># \u5217\u51fa\u6240\u6709\u76d1\u542c\u7684 TCP \u7aef\u53e3<\/span><br \/>\nss <span class=\"token parameter variable\">-tlnp<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token number\">8080<\/span>       <span class=\"token comment\"># \u770b 8080 \u88ab\u8c01\u5360\u4e86<\/span><\/p>\n<p><span class=\"token comment\"># netstat&#xff08;\u8001&#xff0c;\u90e8\u5206\u7cfb\u7edf\u8981\u88c5 net-tools&#xff09;<\/span><br \/>\n<span class=\"token function\">netstat<\/span> <span class=\"token parameter variable\">-tlnp<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token number\">8080<\/span><\/p>\n<p><span class=\"token comment\"># \u53c2\u6570\u542b\u4e49&#xff1a;-t TCP  -l \u76d1\u542c  -n \u663e\u793a\u6570\u5b57(\u4e0d\u89e3\u6790\u57df\u540d)  -p \u663e\u793a\u8fdb\u7a0b<\/span><\/p>\n<p><span class=\"token comment\"># lsof&#xff1a;\u67e5\u67d0\u7aef\u53e3\u5bf9\u5e94\u7684\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-i:8080<\/span>               <span class=\"token comment\"># \u8c01\u5728\u7528 8080<\/span><br \/>\n<span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-i:8080<\/span> <span class=\"token parameter variable\">-t<\/span>            <span class=\"token comment\"># \u53ea\u8f93\u51fa PID&#xff08;\u65b9\u4fbf kill&#xff09;<\/span><\/p>\n<p><span class=\"token comment\"># \u2605\u4e00\u952e\u627e\u5230\u5e76\u6740\u6389\u5360\u7528\u7aef\u53e3\u7684\u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-i:8080<\/span> <span class=\"token parameter variable\">-t<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">xargs<\/span> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span><\/p>\n<p>\u8f93\u51fa\u89e3\u8bfb&#xff1a;<\/p>\n<p>LISTEN  0  100  *:8080  *:*  users:((&#034;java&#034;,pid&#061;12345,fd&#061;28))<br \/>\n                                              \u2514\u2500\u5360\u7528\u7aef\u53e3\u7684 PID<\/p>\n<hr \/>\n<h3>6. \u540e\u53f0\u4efb\u52a1\u7ba1\u7406<\/h3>\n<p><span class=\"token function\">jobs<\/span>                <span class=\"token comment\"># \u67e5\u770b\u5f53\u524d shell \u7684\u540e\u53f0\u4efb\u52a1<\/span><br \/>\n\u547d\u4ee4 <span class=\"token operator\">&amp;<\/span>              <span class=\"token comment\"># \u547d\u4ee4\u540e\u53f0\u8fd0\u884c<\/span><br \/>\nCtrl&#043;Z              <span class=\"token comment\"># \u628a\u524d\u53f0\u4efb\u52a1\u6682\u505c\u5e76\u8f6c\u540e\u53f0<\/span><br \/>\n<span class=\"token function\">bg<\/span>                  <span class=\"token comment\"># \u8ba9\u6682\u505c\u7684\u4efb\u52a1\u540e\u53f0\u7ee7\u7eed\u8dd1<\/span><br \/>\n<span class=\"token function\">fg<\/span>                  <span class=\"token comment\"># \u628a\u540e\u53f0\u4efb\u52a1\u8c03\u56de\u524d\u53f0<\/span><br \/>\n<span class=\"token function\">nohup<\/span> \u547d\u4ee4 <span class=\"token operator\">&amp;<\/span>        <span class=\"token comment\"># \u540e\u53f0\u8fd0\u884c\u4e14\u5173\u6389\u7ec8\u7aef\u4e5f\u4e0d\u505c&#xff08;\u90e8\u7f72\u5e38\u7528&#xff0c;\u89c110\u7bc7&#xff09;<\/span><\/p>\n<hr \/>\n<h3>7. \u5b9e\u6218\u573a\u666f<\/h3>\n<p><span class=\"token comment\"># \u573a\u666f1&#xff1a;\u670d\u52a1\u542f\u52a8\u62a5\u201c\u7aef\u53e3\u88ab\u5360\u7528\u201d<\/span><br \/>\nss <span class=\"token parameter variable\">-tlnp<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token number\">8080<\/span>        <span class=\"token comment\"># \u627e\u5230\u5360\u7528\u7684 PID<\/span><br \/>\n<span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span> <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span>               <span class=\"token comment\"># \u6740\u6389<\/span><br \/>\n<span class=\"token comment\"># \u6216\u4e00\u6761\u547d\u4ee4&#xff1a;<\/span><br \/>\n<span class=\"token function\">lsof<\/span> <span class=\"token parameter variable\">-i:8080<\/span> <span class=\"token parameter variable\">-t<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">xargs<\/span> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span><\/p>\n<p><span class=\"token comment\"># \u573a\u666f2&#xff1a;\u786e\u8ba4\u6211\u7684\u670d\u52a1\u5728\u4e0d\u5728\u8dd1<\/span><br \/>\njps <span class=\"token parameter variable\">-l<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> app<br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-ef<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> app.jar <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-v<\/span> <span class=\"token function\">grep<\/span><\/p>\n<p><span class=\"token comment\"># \u573a\u666f3&#xff1a;\u670d\u52a1\u5361\u6b7b\u6ca1\u54cd\u5e94<\/span><br \/>\njps                         <span class=\"token comment\"># \u62ff\u5230 PID<\/span><br \/>\njstack <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span> <span class=\"token operator\">&gt;<\/span> \/tmp\/stack.txt   <span class=\"token comment\"># \u5bfc\u51fa\u7ebf\u7a0b\u6808\u5206\u6790<\/span><br \/>\n<span class=\"token function\">top<\/span> <span class=\"token parameter variable\">-p<\/span> <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span>                <span class=\"token comment\"># \u770b\u662f\u4e0d\u662f CPU \u6253\u6ee1<\/span><\/p>\n<p><span class=\"token comment\"># \u573a\u666f4&#xff1a;\u4f18\u96c5\u91cd\u542f<\/span><br \/>\n<span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-ef<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> app.jar <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-v<\/span> <span class=\"token function\">grep<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $2}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">xargs<\/span> <span class=\"token function\">kill<\/span><br \/>\n<span class=\"token comment\"># \u7b49\u51e0\u79d2\u786e\u8ba4\u9000\u51fa\u540e\u518d\u542f\u52a8<\/span><\/p>\n<hr \/>\n<h3>8. \u5751\u4e0e\u6700\u4f73\u5b9e\u8df5<\/h3>\n<ul>\n<li>\u26a0\ufe0f grep java \u4f1a\u628a grep \u81ea\u5df1\u4e5f\u5339\u914d\u8fdb\u53bb&#xff0c;\u8bb0\u5f97 | grep -v grep \u6392\u9664\u3002<\/li>\n<li>\u2705 \u6740 Java \u8fdb\u7a0b\u4f18\u5148 kill&#xff08;15&#xff09;&#xff0c;\u7ed9\u4f18\u96c5\u505c\u673a\u673a\u4f1a&#xff1b;\u5361\u6b7b\u624d kill -9\u3002<\/li>\n<li>\u2705 \u67e5\u7aef\u53e3 ss -tlnp \u6bd4 netstat \u5feb\u4e14\u65b0\u7cfb\u7edf\u9ed8\u8ba4\u6709\u3002<\/li>\n<li>\u26a0\ufe0f killall \/ pkill \u8303\u56f4\u5927&#xff0c;\u751f\u4ea7\u73af\u5883\u5c0f\u5fc3\u8bef\u6740\u3002<\/li>\n<li>&#x1f4a1; \u8bb0\u4f4f lsof -i:\u7aef\u53e3 -t | xargs kill -9 \u8fd9\u4e2a\u4e00\u952e\u6e05\u7aef\u53e3\u795e\u5668\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>9. \u672c\u7bc7\u901f\u8bb0<\/h3>\n<p><span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-ef<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token function\">java<\/span>        <span class=\"token comment\"># \u67e5\u8fdb\u7a0b<\/span><br \/>\njps <span class=\"token parameter variable\">-l<\/span>                    <span class=\"token comment\"># \u67e5 Java \u8fdb\u7a0b<\/span><br \/>\n<span class=\"token function\">top<\/span> \/ <span class=\"token function\">htop<\/span>                <span class=\"token comment\"># \u5b9e\u65f6\u76d1\u63a7<\/span><br \/>\n<span class=\"token function\">kill<\/span> <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span> \/ <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span> <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span>  <span class=\"token comment\"># \u7ed3\u675f\u8fdb\u7a0b<\/span><br \/>\nss <span class=\"token parameter variable\">-tlnp<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> \u7aef\u53e3       <span class=\"token comment\"># \u67e5\u7aef\u53e3\u5360\u7528<\/span><br \/>\n<span class=\"token function\">lsof<\/span> -i:\u7aef\u53e3 <span class=\"token parameter variable\">-t<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">xargs<\/span> <span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span>   <span class=\"token comment\"># \u4e00\u952e\u6e05\u7aef\u53e3 \u2605<\/span><br \/>\njstack <span class=\"token operator\">&lt;<\/span>PID<span class=\"token operator\">&gt;<\/span>              <span class=\"token comment\"># \u770b\u7ebf\u7a0b\u6808&#xff08;\u5361\u6b7b\u6392\u67e5&#xff09;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>07 \u00b7 \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406\u4e00\u53e5\u8bdd\u5b9a\u4f4d&#xff1a;\u5224\u65ad\u201c\u6211\u7684\u670d\u52a1\u8fd8\u6d3b\u7740\u5417\u201d\u201c\u7aef\u53e3\u88ab\u8c01\u5360\u4e86\u201d\u201c\u600e\u4e48\u6740\u6389\u5361\u6b7b\u7684\u8fdb\u7a0b\u201d\u30021. \u67e5\u8fdb\u7a0b&#xff1a;ps<br \/>\n# \u6700\u5e38\u7528\u7ec4\u5408&#xff1a;\u67e5\u6240\u6709\u8fdb\u7a0b<br \/>\nps -ef              # \u5168\u683c\u5f0f\u5217\u51fa\u6240\u6709\u8fdb\u7a0b<br \/>\nps aux              # \u53e6\u4e00\u79cd\u98ce\u683c&#xff08;\u5e26CPU\/\u5185\u5b58\u5360\u7528&#xff09;# \u2605\u5b9e\u6218&#xff1a;\u67e5\u81ea\u5df1\u7684 Java \u8fdb\u7a0b<br \/>\nps -ef | grep java<br \/>\nps -ef | grep ap<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,81,44],"topic":[],"class_list":["post-117063","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-python","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406 - \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\/117063.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"07 \u00b7 \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406\u4e00\u53e5\u8bdd\u5b9a\u4f4d&#xff1a;\u5224\u65ad\u201c\u6211\u7684\u670d\u52a1\u8fd8\u6d3b\u7740\u5417\u201d\u201c\u7aef\u53e3\u88ab\u8c01\u5360\u4e86\u201d\u201c\u600e\u4e48\u6740\u6389\u5361\u6b7b\u7684\u8fdb\u7a0b\u201d\u30021. \u67e5\u8fdb\u7a0b&#xff1a;ps # \u6700\u5e38\u7528\u7ec4\u5408&#xff1a;\u67e5\u6240\u6709\u8fdb\u7a0b ps -ef       # \u5168\u683c\u5f0f\u5217\u51fa\u6240\u6709\u8fdb\u7a0b ps aux       # \u53e6\u4e00\u79cd\u98ce\u683c&#xff08;\u5e26CPU\/\u5185\u5b58\u5360\u7528&#xff09;# \u2605\u5b9e\u6218&#xff1a;\u67e5\u81ea\u5df1\u7684 Java \u8fdb\u7a0b ps -ef | grep java ps -ef | grep ap\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/117063.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-22T05:24:41+00:00\" \/>\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\/117063.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/117063.html\",\"name\":\"07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-22T05:24:41+00:00\",\"dateModified\":\"2026-10-22T05:24:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/117063.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/117063.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117063.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406\"}]},{\"@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":"07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406 - \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\/117063.html","og_locale":"zh_CN","og_type":"article","og_title":"07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"07 \u00b7 \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406\u4e00\u53e5\u8bdd\u5b9a\u4f4d&#xff1a;\u5224\u65ad\u201c\u6211\u7684\u670d\u52a1\u8fd8\u6d3b\u7740\u5417\u201d\u201c\u7aef\u53e3\u88ab\u8c01\u5360\u4e86\u201d\u201c\u600e\u4e48\u6740\u6389\u5361\u6b7b\u7684\u8fdb\u7a0b\u201d\u30021. \u67e5\u8fdb\u7a0b&#xff1a;ps # \u6700\u5e38\u7528\u7ec4\u5408&#xff1a;\u67e5\u6240\u6709\u8fdb\u7a0b ps -ef       # \u5168\u683c\u5f0f\u5217\u51fa\u6240\u6709\u8fdb\u7a0b ps aux       # \u53e6\u4e00\u79cd\u98ce\u683c&#xff08;\u5e26CPU\/\u5185\u5b58\u5360\u7528&#xff09;# \u2605\u5b9e\u6218&#xff1a;\u67e5\u81ea\u5df1\u7684 Java \u8fdb\u7a0b ps -ef | grep java ps -ef | grep ap","og_url":"https:\/\/www.wsisp.com\/helps\/117063.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-22T05:24:41+00:00","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\/117063.html","url":"https:\/\/www.wsisp.com\/helps\/117063.html","name":"07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-22T05:24:41+00:00","dateModified":"2026-10-22T05:24:41+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/117063.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/117063.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/117063.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"07 \u00b7 Linux \u8fdb\u7a0b\u4e0e\u7aef\u53e3\u7ba1\u7406"}]},{"@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\/117063","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=117063"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117063\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=117063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=117063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=117063"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=117063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}