{"id":74842,"date":"2026-02-10T19:41:06","date_gmt":"2026-02-10T11:41:06","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/74842.html"},"modified":"2026-02-10T19:41:06","modified_gmt":"2026-02-10T11:41:06","slug":"0%e5%9f%ba%e7%a1%80%e5%ad%a6%e5%b5%8c%e5%85%a5%e5%bc%8f-%e5%85%a8%e7%bd%91%e6%9c%80%e8%af%a6%e7%bb%86linux%e5%bc%80%e5%8f%91%e6%8c%87%e5%8d%97%ef%bc%9a%e4%b8%80%e7%af%87%e6%96%87%e7%ab%a0%e5%b8%a6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/74842.html","title":{"rendered":"0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f--\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b"},"content":{"rendered":"<h2>Linux\u8fdb\u7a0b\u5b8c\u5168\u6307\u5357&#xff1a;\u4ece\u7a0b\u5e8f\u5230PCB\u7684\u6df1\u5ea6\u89e3\u6790<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7406\u89e3\u8fdb\u7a0b\u662f\u7406\u89e3\u64cd\u4f5c\u7cfb\u7edf\u7684\u5173\u952e\u3002\u672c\u6587\u5e26\u4f60\u4ece\u7a0b\u5e8f\u52a0\u8f7d\u5230\u8fdb\u7a0b\u8c03\u5ea6&#xff0c;\u5f7b\u5e95\u638c\u63e1Linux\u8fdb\u7a0b\u7ba1\u7406\u7684\u6240\u6709\u6838\u5fc3\u6982\u5ff5\u3002<\/p>\n<h3>\u4e00\u3001\u7a0b\u5e8f vs \u8fdb\u7a0b&#xff1a;\u9759\u6001\u4e0e\u52a8\u6001\u7684\u54f2\u5b66<\/h3>\n<h4>1.1 \u57fa\u672c\u6982\u5ff5\u6f84\u6e05<\/h4>\n<p>\/\/ \u7a0b\u5e8f&#xff1a;\u9759\u6001\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6<br \/>\n\/\/ \u793a\u4f8b&#xff1a;\u7f16\u8bd1\u540e\u7684a.out<br \/>\n$ gcc hello.c -o hello  # \u751f\u6210\u7a0b\u5e8f\u6587\u4ef6<\/p>\n<p>\/\/ \u8fdb\u7a0b&#xff1a;\u7a0b\u5e8f\u7684\u4e00\u6b21\u6267\u884c\u5b9e\u4f8b<br \/>\n$ .\/hello &amp;             # \u542f\u52a8\u4e00\u4e2a\u8fdb\u7a0b<br \/>\n$ .\/hello &amp;             # \u518d\u542f\u52a8\u4e00\u4e2a\u8fdb\u7a0b&#xff08;\u540c\u4e00\u4e2a\u7a0b\u5e8f&#xff0c;\u4e0d\u540c\u8fdb\u7a0b&#xff09;<\/p>\n<p>\u5173\u952e\u533a\u522b&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7a0b\u5e8f&#xff1a;\u5b58\u653e\u5728\u786c\u76d8\u4e2d\u7684\u6570\u636e\u96c6\u5408&#xff08;\u9759\u6001&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u7a0b&#xff1a;\u7a0b\u5e8f\u52a8\u6001\u6267\u884c\u7684\u5168\u8fc7\u7a0b&#xff08;\u52a8\u6001&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>\u7c7b\u6bd4\u7406\u89e3&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7a0b\u5e8f &#061; \u4e50\u8c31&#xff08;\u9759\u6001\u7684\u7b26\u53f7&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u7a0b &#061; \u6f14\u594f\u8fc7\u7a0b&#xff08;\u52a8\u6001\u7684\u6267\u884c&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h4>1.2 \u8fdb\u7a0b\u76d1\u63a7\u547d\u4ee4\u5927\u5168<\/h4>\n<h5>\u5b9e\u65f6\u67e5\u770b\u8fdb\u7a0b<\/h5>\n<p># 1. top &#8211; \u52a8\u6001\u76d1\u63a7&#xff08;\u7c7b\u4f3cWindows\u7684\u4efb\u52a1\u7ba1\u7406\u5668&#xff09;<br \/>\ntop<br \/>\n# \u6392\u5e8f&#xff1a;\u6309P&#xff08;CPU&#xff09;\u3001M&#xff08;\u5185\u5b58&#xff09;\u3001T&#xff08;\u8fd0\u884c\u65f6\u95f4&#xff09;<br \/>\n# \u9000\u51fa&#xff1a;q<\/p>\n<p># 2. htop &#8211; \u589e\u5f3a\u7248top&#xff08;\u9700\u8981\u5b89\u88c5&#xff09;<br \/>\nsudo apt install htop<br \/>\nhtop<\/p>\n<h5>\u8fdb\u7a0b\u4fe1\u606f\u67e5\u8be2<\/h5>\n<p># \u67e5\u770b\u6240\u6709\u8fdb\u7a0b&#xff08;\u6807\u51c6\u683c\u5f0f&#xff09;<br \/>\nps -ef<\/p>\n<p># \u67e5\u770b\u8fdb\u7a0b\u8be6\u7ec6\u4fe1\u606f&#xff08;BSD\u683c\u5f0f&#xff09;<br \/>\nps aux<\/p>\n<p># \u5e38\u7528\u7ec4\u5408&#xff1a;\u67e5\u627e\u7279\u5b9a\u8fdb\u7a0b<br \/>\nps -ef | grep nginx      # \u67e5\u627enginx\u8fdb\u7a0b<br \/>\nps aux | grep &#034;python&#034;   # \u67e5\u627ePython\u76f8\u5173\u8fdb\u7a0b<\/p>\n<p># \u67e5\u770b\u8fdb\u7a0b\u6811\u72b6\u7ed3\u6784<br \/>\npstree<br \/>\npstree -p               # \u663e\u793aPID<\/p>\n<h5>\u8fdb\u7a0b\u63a7\u5236\u547d\u4ee4<\/h5>\n<p># 1. \u6740\u6b7b\u8fdb\u7a0b<br \/>\nkill 1234               # \u6b63\u5e38\u7ec8\u6b62PID\u4e3a1234\u7684\u8fdb\u7a0b<br \/>\nkill -9 1234            # \u5f3a\u5236\u6740\u6b7b&#xff08;SIGKILL&#xff09;<br \/>\nkillall firefox         # \u6740\u6b7b\u6240\u6709firefox\u8fdb\u7a0b<br \/>\npkill -f &#034;pattern&#034;      # \u6839\u636e\u6a21\u5f0f\u6740\u6b7b\u8fdb\u7a0b<\/p>\n<p># 2. \u540e\u53f0\u4efb\u52a1\u7ba1\u7406<br \/>\n.\/server &amp;              # \u540e\u53f0\u8fd0\u884c<br \/>\njobs                    # \u67e5\u770b\u540e\u53f0\u4efb\u52a1<br \/>\nfg %1                   # \u5c06\u4efb\u52a11\u653e\u5230\u524d\u53f0<br \/>\nbg %1                   # \u5c06\u6682\u505c\u7684\u4efb\u52a11\u653e\u5230\u540e\u53f0\u7ee7\u7eed\u8fd0\u884c<\/p>\n<p># 3. \u8fdb\u7a0b\u4f18\u5148\u7ea7<br \/>\nnice -n 10 .\/task.sh    # \u4f4e\u4f18\u5148\u7ea7\u8fd0\u884c&#xff08;nice\u503c-20\u523019&#xff0c;\u8d8a\u5927\u4f18\u5148\u7ea7\u8d8a\u4f4e&#xff09;<br \/>\nrenice 5 -p 1234        # \u4fee\u6539\u8fd0\u884c\u4e2d\u8fdb\u7a0b\u7684\u4f18\u5148\u7ea7<\/p>\n<h3>\u4e8c\u3001\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4&#xff1a;4GB\u865a\u62df\u5185\u5b58\u7684\u79d8\u5bc6<\/h3>\n<h4>2.1 \u865a\u62df\u5730\u5740 vs \u7269\u7406\u5730\u5740<\/h4>\n<p>\/\/ \u7a0b\u5e8f\u5458\u770b\u5230\u7684\u662f\u865a\u62df\u5730\u5740<br \/>\nint *p &#061; malloc(sizeof(int));  \/\/ \u8fd4\u56de\u865a\u62df\u5730\u5740<\/p>\n<p>\/\/ \u5b9e\u9645\u7269\u7406\u5730\u5740\u7531MMU&#xff08;\u5185\u5b58\u7ba1\u7406\u5355\u5143&#xff09;\u7ba1\u7406<br \/>\n\/\/ CPU \u2192 MMU \u2192 \u7269\u7406RAM<\/p>\n<p>\u4e3a\u4ec0\u4e48\u9700\u8981\u865a\u62df\u5730\u5740&#xff1f;<\/p>\n<li>\n<p>\u5185\u5b58\u4fdd\u62a4&#xff1a;\u8fdb\u7a0b\u95f4\u9694\u79bb&#xff0c;\u9632\u6b62\u76f8\u4e92\u5e72\u6270<\/p>\n<\/li>\n<li>\n<p>\u5185\u5b58\u6269\u5c55&#xff1a;\u53ef\u4f7f\u7528\u6bd4\u7269\u7406\u5185\u5b58\u66f4\u5927\u7684\u5730\u5740\u7a7a\u95f4<\/p>\n<\/li>\n<li>\n<p>\u7b80\u5316\u7f16\u7a0b&#xff1a;\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u6709\u72ec\u7acb\u76844GB\u5730\u5740\u7a7a\u95f4<\/p>\n<\/li>\n<h4>2.2 \u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u5e03\u5c40&#xff08;32\u4f4d\u7cfb\u7edf&#xff09;<\/h4>\n<p>0xFFFFFFFF<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2190 \u5185\u6838\u7a7a\u95f4&#xff08;1GB&#xff0c;\u7528\u6237\u4e0d\u53ef\u8bbf\u95ee&#xff09;<br \/>\n\u2502     \u5185\u6838        \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2190 0xC0000000<br \/>\n\u2502     \u6808\u533a        \u2502 \u2190 \u5411\u4e0b\u589e\u957f&#xff0c;\u5b58\u50a8\u5c40\u90e8\u53d8\u91cf<br \/>\n\u2502      \u2193          \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502      &#8230;        \u2502 \u2190 \u672a\u6620\u5c04\u533a\u57df<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502     \u5806\u533a        \u2502 \u2190 \u5411\u4e0a\u589e\u957f&#xff0c;\u52a8\u6001\u5206\u914d<br \/>\n\u2502      \u2191          \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502    .bss\u6bb5       \u2502 \u2190 \u672a\u521d\u59cb\u5316\u5168\u5c40\/\u9759\u6001\u53d8\u91cf&#xff08;\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0&#xff09;<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502    .data\u6bb5      \u2502 \u2190 \u5df2\u521d\u59cb\u5316\u5168\u5c40\/\u9759\u6001\u53d8\u91cf<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502   .rodata\u6bb5     \u2502 \u2190 \u53ea\u8bfb\u6570\u636e&#xff08;\u5b57\u7b26\u4e32\u5e38\u91cf&#xff09;<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502    .text\u6bb5      \u2502 \u2190 \u4ee3\u7801\u6bb5&#xff08;\u673a\u5668\u6307\u4ee4&#xff09;<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2190 0x00000000<\/p>\n<h4>2.3 \u5404\u5185\u5b58\u533a\u57df\u8be6\u89e3<\/h4>\n<h5>1. \u4ee3\u7801\u6bb5 (.text)<\/h5>\n<p>\/\/ \u5b58\u50a8\u673a\u5668\u6307\u4ee4<br \/>\nvoid func() {<br \/>\n    printf(&#034;Hello&#034;);  \/\/ \u8fd9\u90e8\u5206\u4ee3\u7801\u5728.text\u6bb5<br \/>\n}<\/p>\n<h5>2. \u6570\u636e\u6bb5<\/h5>\n<p>\/\/ .rodata&#xff1a;\u53ea\u8bfb\u6570\u636e\u6bb5<br \/>\nchar *str &#061; &#034;Hello&#034;;  \/\/ \u5b57\u7b26\u4e32&#034;Hello&#034;\u5728.rodata<\/p>\n<p>\/\/ .data&#xff1a;\u5df2\u521d\u59cb\u5316\u5168\u5c40\/\u9759\u6001\u53d8\u91cf<br \/>\nint global_init &#061; 100;        \/\/ \u5728.data\u6bb5<br \/>\nstatic int static_init &#061; 200; \/\/ \u5728.data\u6bb5<\/p>\n<p>\/\/ .bss&#xff1a;\u672a\u521d\u59cb\u5316\u5168\u5c40\/\u9759\u6001\u53d8\u91cf<br \/>\nint global_uninit;            \/\/ \u5728.bss\u6bb5&#xff0c;\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0<br \/>\nstatic int static_uninit;     \/\/ \u5728.bss\u6bb5&#xff0c;\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0<\/p>\n<h5>3. \u6808\u533a (Stack)<\/h5>\n<p>void func() {<br \/>\n    int local_var &#061; 10;       \/\/ \u5c40\u90e8\u53d8\u91cf\u5728\u6808\u533a<br \/>\n    char buffer[100];         \/\/ \u6570\u7ec4\u5728\u6808\u533a<br \/>\n} \/\/ \u51fd\u6570\u7ed3\u675f&#xff0c;\u5c40\u90e8\u53d8\u91cf\u81ea\u52a8\u91ca\u653e<\/p>\n<p>\u6808\u533a\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5927\u5c0f\u9ed8\u8ba4\u7ea68MB&#xff08;\u53ef\u7528ulimit -s\u67e5\u770b&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5411\u4e0b\u589e\u957f&#xff08;\u9ad8\u5730\u5740 \u2192 \u4f4e\u5730\u5740&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u81ea\u52a8\u7ba1\u7406&#xff08;\u7f16\u8bd1\u5668\u8d1f\u8d23\u5206\u914d\u91ca\u653e&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5b58\u50a8&#xff1a;\u5c40\u90e8\u53d8\u91cf\u3001\u51fd\u6570\u53c2\u6570\u3001\u8fd4\u56de\u5730\u5740<\/p>\n<\/li>\n<\/ul>\n<h5>4. \u5806\u533a (Heap)<\/h5>\n<p>\/\/ \u52a8\u6001\u5185\u5b58\u5206\u914d<br \/>\nint *p &#061; (int*)malloc(100 * sizeof(int));  \/\/ \u5728\u5806\u533a\u5206\u914d<br \/>\nfree(p);  \/\/ \u5fc5\u987b\u624b\u52a8\u91ca\u653e<\/p>\n<p>\u5806\u533a\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5411\u4e0a\u589e\u957f&#xff08;\u4f4e\u5730\u5740 \u2192 \u9ad8\u5730\u5740&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u624b\u52a8\u7ba1\u7406&#xff08;\u7a0b\u5e8f\u5458\u8d1f\u8d23\u5206\u914d\u91ca\u653e&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5927\u5c0f\u53d7\u7cfb\u7edf\u5269\u4f59\u5185\u5b58\u9650\u5236<\/p>\n<\/li>\n<li>\n<p>\u5206\u914d\u8f83\u6162&#xff08;\u9700\u8981\u7cfb\u7edf\u8c03\u7528&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h3>\u4e09\u3001\u8fdb\u7a0b\u521b\u5efa&#xff1a;fork\u7684\u9b54\u6cd5<\/h3>\n<h4>3.1 fork\u51fd\u6570\u8be6\u89e3<\/h4>\n<p>#include &lt;unistd.h&gt;<br \/>\n#include &lt;stdio.h&gt;<\/p>\n<p>int main() {<br \/>\n    pid_t pid &#061; fork();  \/\/ \u5173\u952e\u8c03\u7528<\/p>\n<p>    if (pid &lt; 0) {<br \/>\n        \/\/ \u9519\u8bef&#xff1a;fork\u5931\u8d25<br \/>\n        perror(&#034;fork failed&#034;);<br \/>\n        return -1;<br \/>\n    } else if (pid &#061;&#061; 0) {<br \/>\n        \/\/ \u5b50\u8fdb\u7a0b&#xff1a;fork\u8fd4\u56de0<br \/>\n        printf(&#034;\u6211\u662f\u5b50\u8fdb\u7a0b&#xff0c;PID&#061;%d&#xff0c;\u7236\u8fdb\u7a0bPID&#061;%d\\\\n&#034;,<br \/>\n               getpid(), getppid());<br \/>\n    } else {<br \/>\n        \/\/ \u7236\u8fdb\u7a0b&#xff1a;fork\u8fd4\u56de\u5b50\u8fdb\u7a0bPID<br \/>\n        printf(&#034;\u6211\u662f\u7236\u8fdb\u7a0b&#xff0c;PID&#061;%d&#xff0c;\u521b\u5efa\u7684\u5b50\u8fdb\u7a0bPID&#061;%d\\\\n&#034;,<br \/>\n               getpid(), pid);<br \/>\n    }<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>fork\u7684\u6267\u884c\u8fc7\u7a0b&#xff1a;<\/p>\n<p>\u7236\u8fdb\u7a0b\u6267\u884cfork()<br \/>\n    \u2193<br \/>\n\u64cd\u4f5c\u7cfb\u7edf\u521b\u5efa\u5b50\u8fdb\u7a0b<br \/>\n    \u2193<br \/>\n\u590d\u5236\u7236\u8fdb\u7a0b\u7684&#xff1a;\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u5806\u3001\u6808\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26\u8868<br \/>\n    \u2193<br \/>\n\u7236\u5b50\u8fdb\u7a0b\u4ecefork()\u8fd4\u56de\u5904\u7ee7\u7eed\u6267\u884c<br \/>\n    \u2193<br \/>\n\u7236\u8fdb\u7a0b&#xff1a;fork()\u8fd4\u56de\u5b50\u8fdb\u7a0bPID&#xff08;&gt;0&#xff09;<br \/>\n\u5b50\u8fdb\u7a0b&#xff1a;fork()\u8fd4\u56de0<\/p>\n<h4>3.2 \u83b7\u53d6\u8fdb\u7a0bID<\/h4>\n<p>#include &lt;unistd.h&gt;<\/p>\n<p>\/\/ \u83b7\u53d6\u5f53\u524d\u8fdb\u7a0bID<br \/>\npid_t my_pid &#061; getpid();<br \/>\nprintf(&#034;\u5f53\u524d\u8fdb\u7a0bID&#xff1a;%d\\\\n&#034;, my_pid);<\/p>\n<p>\/\/ \u83b7\u53d6\u7236\u8fdb\u7a0bID<br \/>\npid_t parent_pid &#061; getppid();<br \/>\nprintf(&#034;\u7236\u8fdb\u7a0bID&#xff1a;%d\\\\n&#034;, parent_pid);<\/p>\n<p>\/\/ \u5b9e\u9645\u5e94\u7528&#xff1a;\u521b\u5efa\u5b88\u62a4\u8fdb\u7a0b<br \/>\nif (fork() &gt; 0) {<br \/>\n    exit(0);  \/\/ \u7236\u8fdb\u7a0b\u9000\u51fa<br \/>\n}<br \/>\n\/\/ \u5b50\u8fdb\u7a0b\u7ee7\u7eed\u6267\u884c&#xff08;\u6210\u4e3a\u5b88\u62a4\u8fdb\u7a0b&#xff09;<br \/>\nsetsid();  \/\/ \u521b\u5efa\u65b0\u4f1a\u8bdd<\/p>\n<h3>\u56db\u3001\u8fdb\u7a0b\u72b6\u6001&#xff1a;\u751f\u547d\u7684\u4e03\u4e2a\u9636\u6bb5<\/h3>\n<h4>4.1 \u4e03\u79cd\u8fdb\u7a0b\u72b6\u6001\u8be6\u89e3<\/h4>\n<p>\/\/ \u8fdb\u7a0b\u72b6\u6001\u67e5\u770b<br \/>\nps aux | grep process_name<br \/>\n\/\/ STAT\u5217\u663e\u793a\u8fdb\u7a0b\u72b6\u6001&#xff1a;<br \/>\n\/\/ R: \u8fd0\u884c\/\u5c31\u7eea<br \/>\n\/\/ S: \u53ef\u4e2d\u65ad\u7761\u7720<br \/>\n\/\/ D: \u4e0d\u53ef\u4e2d\u65ad\u7761\u7720<br \/>\n\/\/ T: \u505c\u6b62<br \/>\n\/\/ Z: \u50f5\u5c38<br \/>\n\/\/ X: \u6b7b\u4ea1<\/p>\n<h5>1. \u8fd0\u884c\u6001 (R &#8211; Running)<\/h5>\n<p># \u793a\u4f8b&#xff1a;CPU\u5bc6\u96c6\u578b\u8fdb\u7a0b<br \/>\nwhile true; do echo &#034;running&#034;; done &amp;<br \/>\nps aux | grep &#034;while&#034;<br \/>\n# STAT\u663e\u793a&#xff1a;R<\/p>\n<h5>2. \u5c31\u7eea\u6001 (R &#8211; Ready)<\/h5>\n<p>\/\/ \u591a\u4e2a\u8fdb\u7a0b\u7ade\u4e89CPU<br \/>\n\/\/ \u5904\u4e8e\u5c31\u7eea\u961f\u5217&#xff0c;\u7b49\u5f85\u8c03\u5ea6<\/p>\n<h5>3. \u53ef\u4e2d\u65ad\u7b49\u5f85\u6001 (S &#8211; Interruptible Sleep)<\/h5>\n<p># \u793a\u4f8b&#xff1a;\u7b49\u5f85\u7528\u6237\u8f93\u5165<br \/>\nread -p &#034;\u8bf7\u8f93\u5165&#xff1a;&#034; input &amp;<br \/>\nps aux | grep &#034;read&#034;<br \/>\n# STAT\u663e\u793a&#xff1a;S<\/p>\n<h5>4. \u4e0d\u53ef\u4e2d\u65ad\u7b49\u5f85\u6001 (D &#8211; Uninterruptible Sleep)<\/h5>\n<p># \u901a\u5e38\u53d1\u751f\u5728\u7b49\u5f85\u78c1\u76d8I\/O<br \/>\n# \u65e0\u6cd5\u88ab\u4fe1\u53f7\u4e2d\u65ad<\/p>\n<h5>5. \u505c\u6b62\u6001 (T &#8211; Stopped)<\/h5>\n<p># \u53d1\u9001SIGSTOP\u4fe1\u53f7<br \/>\nkill -STOP 1234<br \/>\n# \u6062\u590d\u8fd0\u884c<br \/>\nkill -CONT 1234<\/p>\n<h5>6. \u50f5\u5c38\u6001 (Z &#8211; Zombie)<\/h5>\n<p>#include &lt;stdlib.h&gt;<br \/>\n#include &lt;unistd.h&gt;<\/p>\n<p>int main() {<br \/>\n    pid_t pid &#061; fork();<\/p>\n<p>    if (pid &#061;&#061; 0) {<br \/>\n        \/\/ \u5b50\u8fdb\u7a0b\u7acb\u5373\u9000\u51fa&#xff0c;\u6210\u4e3a\u50f5\u5c38<br \/>\n        exit(0);<br \/>\n    } else {<br \/>\n        \/\/ \u7236\u8fdb\u7a0b\u4e0d\u56de\u6536\u5b50\u8fdb\u7a0b<br \/>\n        sleep(30);  \/\/ \u5728\u6b64\u671f\u95f4&#xff0c;\u5b50\u8fdb\u7a0b\u662f\u50f5\u5c38\u72b6\u6001<br \/>\n        \/\/ \u5e94\u8be5\u8c03\u7528wait()\u56de\u6536\u5b50\u8fdb\u7a0b<br \/>\n    }<br \/>\n    return 0;<br \/>\n}<\/p>\n<h5>7. \u6b7b\u4ea1\u6001 (X &#8211; Dead)<\/h5>\n<p>\/\/ \u8fdb\u7a0b\u5df2\u7ed3\u675f&#xff0c;\u8d44\u6e90\u5df2\u56de\u6536<br \/>\n\/\/ \u901a\u5e38\u770b\u4e0d\u5230\u6b64\u72b6\u6001<\/p>\n<h4>4.2 \u72b6\u6001\u8f6c\u6362\u56fe<\/h4>\n<p>\u521b\u5efa<br \/>\n    \u2193<br \/>\n \u5c31\u7eea\u6001(R) \u2190\u2500\u2500\u2510<br \/>\n    \u2502         \u2502<br \/>\n    \u2193 (\u8c03\u5ea6)  \u2502<br \/>\n \u8fd0\u884c\u6001(R)    \u2502<br \/>\n    \u2502         \u2502<br \/>\n    \u251c\u2500\u2192 \u53ef\u4e2d\u65ad\u7b49\u5f85(S) \u2500\u2500\u2518<br \/>\n    \u2502         \u2502<br \/>\n    \u251c\u2500\u2192 \u4e0d\u53ef\u4e2d\u65ad\u7b49\u5f85(D)<br \/>\n    \u2502         \u2502<br \/>\n    \u251c\u2500\u2192 \u505c\u6b62(T) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n    \u2502         \u2502        \u2502<br \/>\n    \u2193 (\u7ed3\u675f)   \u2502        \u2502<br \/>\n \u50f5\u5c38(Z)      \u2502        \u2502<br \/>\n    \u2502         \u2502        \u2502<br \/>\n    \u2193 (\u56de\u6536)   \u2502        \u2502<br \/>\n \u6b7b\u4ea1(X)      \u2502        \u2502<br \/>\n              \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<h3>\u4e94\u3001\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5&#xff1a;CPU\u7684\u65f6\u95f4\u5206\u914d\u827a\u672f<\/h3>\n<h4>5.1 \u516d\u79cd\u7ecf\u5178\u8c03\u5ea6\u7b97\u6cd5<\/h4>\n<h5>1. \u5148\u6765\u5148\u670d\u52a1 (FCFS)<\/h5>\n<p>\/\/ \u7c7b\u6bd4&#xff1a;\u8d85\u5e02\u6392\u961f<br \/>\n\/\/ \u4f18\u70b9&#xff1a;\u7b80\u5355\u516c\u5e73<br \/>\n\/\/ \u7f3a\u70b9&#xff1a;\u77ed\u4f5c\u4e1a\u53ef\u80fd\u7b49\u5f85\u957f\u4f5c\u4e1a&#xff08;\u62a4\u822a\u6548\u5e94&#xff09;<\/p>\n<h5>2. \u77ed\u4f5c\u4e1a\u4f18\u5148 (SJF)<\/h5>\n<p>\/\/ \u603b\u662f\u8c03\u5ea6\u9884\u8ba1\u8fd0\u884c\u65f6\u95f4\u6700\u77ed\u7684\u8fdb\u7a0b<br \/>\n\/\/ \u4f18\u70b9&#xff1a;\u5e73\u5747\u7b49\u5f85\u65f6\u95f4\u6700\u5c0f<br \/>\n\/\/ \u7f3a\u70b9&#xff1a;\u957f\u4f5c\u4e1a\u53ef\u80fd\u997f\u6b7b<\/p>\n<h5>3. \u4f18\u5148\u7ea7\u8c03\u5ea6<\/h5>\n<p># Linux\u4e2d\u7684\u5b9e\u73b0&#xff1a;nice\u503c<br \/>\nnice -n -20 .\/critical_task  # \u6700\u9ad8\u4f18\u5148\u7ea7<br \/>\nnice -n 19 .\/low_task        # \u6700\u4f4e\u4f18\u5148\u7ea7<\/p>\n<h5>4. \u65f6\u95f4\u7247\u8f6e\u8f6c (RR)<\/h5>\n<p>\/\/ Linux\u9ed8\u8ba4\u8c03\u5ea6\u7b56\u7565<br \/>\n\/\/ \u65f6\u95f4\u7247&#xff1a;5-800ms&#xff08;\u6839\u636e\u7cfb\u7edf\u8d1f\u8f7d\u8c03\u6574&#xff09;<\/p>\n<p>\/\/ \u73b0\u8c61&#xff1a;\u5b8f\u89c2\u5e76\u884c&#xff0c;\u5fae\u89c2\u4e32\u884c<br \/>\nwhile (true) {<br \/>\n    \/\/ \u6bcf\u4e2a\u8fdb\u7a0b\u8fd0\u884c\u4e00\u4e2a\u65f6\u95f4\u7247<br \/>\n    \/\/ \u7136\u540e\u5207\u6362\u5230\u4e0b\u4e00\u4e2a\u8fdb\u7a0b<br \/>\n}<\/p>\n<p>\u67e5\u770b\u65f6\u95f4\u7247&#xff1a;<\/p>\n<p># \u67e5\u770b\u8c03\u5ea6\u53c2\u6570<br \/>\ncat \/proc\/sys\/kernel\/sched_rr_timeslice_ms<\/p>\n<h5>5. \u591a\u7ea7\u53cd\u9988\u961f\u5217 (MLFQ)<\/h5>\n<p>\u961f\u52171&#xff08;\u9ad8\u4f18\u5148\u7ea7&#xff0c;\u65f6\u95f4\u7247\u77ed&#xff09; \u2190 \u65b0\u8fdb\u7a0b<br \/>\n    \u2193&#xff08;\u7528\u5b8c\u65f6\u95f4\u7247\u672a\u7ed3\u675f&#xff09;<br \/>\n\u961f\u52172&#xff08;\u4e2d\u4f18\u5148\u7ea7&#xff0c;\u65f6\u95f4\u7247\u4e2d\u7b49&#xff09;<br \/>\n    \u2193&#xff08;\u7528\u5b8c\u65f6\u95f4\u7247\u672a\u7ed3\u675f&#xff09;<br \/>\n\u961f\u52173&#xff08;\u4f4e\u4f18\u5148\u7ea7&#xff0c;\u65f6\u95f4\u7247\u957f&#xff09;<\/p>\n<h5>6. \u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6<\/h5>\n<p># \u591a\u6838CPU\u4e0a\u7684\u8c03\u5ea6<br \/>\n# \u5c06\u8fdb\u7a0b\u5747\u8861\u5206\u914d\u5230\u5404\u4e2aCPU\u6838\u5fc3<br \/>\ntaskset -c 0,1 .\/program  # \u7ed1\u5b9a\u5230CPU0\u548c1<\/p>\n<h4>5.2 Linux\u8c03\u5ea6\u7b56\u7565\u67e5\u770b<\/h4>\n<p># \u67e5\u770b\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565<br \/>\nchrt -p 1234<\/p>\n<p># \u8bbe\u7f6e\u8c03\u5ea6\u7b56\u7565<br \/>\nchrt -f -p 99 1234        # \u8bbe\u7f6e\u4e3aFIFO&#xff0c;\u4f18\u5148\u7ea799<br \/>\nchrt -r -p 50 1234        # \u8bbe\u7f6e\u4e3aRR&#xff0c;\u4f18\u5148\u7ea750<\/p>\n<h3>\u516d\u3001\u8fdb\u7a0b\u95f4\u7a7a\u95f4\u72ec\u7acb\u6027<\/h3>\n<h4>6.1 \u865a\u62df\u5730\u5740\u7a7a\u95f4\u6620\u5c04<\/h4>\n<p>\u8fdb\u7a0b1\u89c6\u89d2          \u8fdb\u7a0b2\u89c6\u89d2<br \/>\n0xFFFFFFFF       0xFFFFFFFF<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502   \u5185\u6838   \u2502     \u2502   \u5185\u6838   \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524     \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502   \u6808     \u2502     \u2502   \u6808     \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524     \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502   \u5806     \u2502     \u2502   \u5806     \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524     \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502  \u6570\u636e\u6bb5  \u2502     \u2502  \u6570\u636e\u6bb5  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524     \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502  \u4ee3\u7801\u6bb5  \u2502     \u2502  \u4ee3\u7801\u6bb5  \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n      \u2193                \u2193<br \/>\n     MMU&#xff08;\u5185\u5b58\u7ba1\u7406\u5355\u5143&#xff09;<br \/>\n      \u2193                \u2193<br \/>\n   \u7269\u7406RAM\u7684\u4e0d\u540c\u533a\u57df<\/p>\n<h4>6.2 \u9a8c\u8bc1\u8fdb\u7a0b\u7a7a\u95f4\u72ec\u7acb<\/h4>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;unistd.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<\/p>\n<p>int global_var &#061; 100;  \/\/ \u5168\u5c40\u53d8\u91cf<\/p>\n<p>int main() {<br \/>\n    int local_var &#061; 200;  \/\/ \u5c40\u90e8\u53d8\u91cf<br \/>\n    int *heap_var &#061; malloc(sizeof(int));<br \/>\n    *heap_var &#061; 300;<\/p>\n<p>    pid_t pid &#061; fork();<\/p>\n<p>    if (pid &#061;&#061; 0) {<br \/>\n        \/\/ \u5b50\u8fdb\u7a0b\u4fee\u6539\u6240\u6709\u53d8\u91cf<br \/>\n        global_var &#061; 101;<br \/>\n        local_var &#061; 201;<br \/>\n        *heap_var &#061; 301;<\/p>\n<p>        printf(&#034;\u5b50\u8fdb\u7a0b&#xff1a;global&#061;%d, local&#061;%d, heap&#061;%d\\\\n&#034;,<br \/>\n               global_var, local_var, *heap_var);<br \/>\n        exit(0);<br \/>\n    } else {<br \/>\n        \/\/ \u7236\u8fdb\u7a0b\u7b49\u5f85\u5b50\u8fdb\u7a0b\u7ed3\u675f<br \/>\n        wait(NULL);<br \/>\n        printf(&#034;\u7236\u8fdb\u7a0b&#xff1a;global&#061;%d, local&#061;%d, heap&#061;%d\\\\n&#034;,<br \/>\n               global_var, local_var, *heap_var);<br \/>\n    }<\/p>\n<p>    free(heap_var);<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u8f93\u51fa\u7ed3\u679c&#xff1a;<\/p>\n<p>\u5b50\u8fdb\u7a0b&#xff1a;global&#061;101, local&#061;201, heap&#061;301<br \/>\n\u7236\u8fdb\u7a0b&#xff1a;global&#061;100, local&#061;200, heap&#061;300<\/p>\n<p>\u7ed3\u8bba&#xff1a;\u7236\u5b50\u8fdb\u7a0b\u6709\u72ec\u7acb\u7684\u5730\u5740\u7a7a\u95f4&#xff0c;\u4fee\u6539\u4e92\u4e0d\u5f71\u54cd\u3002<\/p>\n<h3>\u4e03\u3001\u5b9e\u6218&#xff1a;\u7f16\u5199\u5065\u58ee\u7684\u8fdb\u7a0b\u7a0b\u5e8f<\/h3>\n<h4>7.1 \u907f\u514d\u50f5\u5c38\u8fdb\u7a0b<\/h4>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\n#include &lt;unistd.h&gt;<br \/>\n#include &lt;sys\/wait.h&gt;<\/p>\n<p>int main() {<br \/>\n    for (int i &#061; 0; i &lt; 5; i&#043;&#043;) {<br \/>\n        pid_t pid &#061; fork();<\/p>\n<p>        if (pid &#061;&#061; 0) {<br \/>\n            \/\/ \u5b50\u8fdb\u7a0b<br \/>\n            printf(&#034;\u5b50\u8fdb\u7a0b%d\u5f00\u59cb&#xff0c;PID&#061;%d\\\\n&#034;, i, getpid());<br \/>\n            sleep(i &#043; 1);  \/\/ \u6a21\u62df\u5de5\u4f5c<br \/>\n            printf(&#034;\u5b50\u8fdb\u7a0b%d\u7ed3\u675f\\\\n&#034;, i);<br \/>\n            exit(0);  \/\/ \u6b63\u5e38\u9000\u51fa<br \/>\n        } else if (pid &gt; 0) {<br \/>\n            \/\/ \u7236\u8fdb\u7a0b<br \/>\n            printf(&#034;\u521b\u5efa\u5b50\u8fdb\u7a0b%d&#xff0c;PID&#061;%d\\\\n&#034;, i, pid);<br \/>\n        } else {<br \/>\n            perror(&#034;fork failed&#034;);<br \/>\n            exit(1);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/\/ \u7236\u8fdb\u7a0b\u56de\u6536\u6240\u6709\u5b50\u8fdb\u7a0b<br \/>\n    int status;<br \/>\n    pid_t child_pid;<\/p>\n<p>    while ((child_pid &#061; wait(&amp;status)) &gt; 0) {<br \/>\n        if (WIFEXITED(status)) {<br \/>\n            printf(&#034;\u5b50\u8fdb\u7a0b%d\u6b63\u5e38\u9000\u51fa&#xff0c;\u8fd4\u56de\u503c&#xff1a;%d\\\\n&#034;,<br \/>\n                   child_pid, WEXITSTATUS(status));<br \/>\n        } else if (WIFSIGNALED(status)) {<br \/>\n            printf(&#034;\u5b50\u8fdb\u7a0b%d\u88ab\u4fe1\u53f7%d\u7ec8\u6b62\\\\n&#034;,<br \/>\n                   child_pid, WTERMSIG(status));<br \/>\n        }<br \/>\n    }<\/p>\n<p>    printf(&#034;\u6240\u6709\u5b50\u8fdb\u7a0b\u5df2\u56de\u6536\\\\n&#034;);<br \/>\n    return 0;<br \/>\n}<\/p>\n<h4>7.2 \u521b\u5efa\u5b88\u62a4\u8fdb\u7a0b<\/h4>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\n#include &lt;unistd.h&gt;<br \/>\n#include &lt;sys\/stat.h&gt;<br \/>\n#include &lt;sys\/types.h&gt;<br \/>\n#include &lt;fcntl.h&gt;<br \/>\n#include &lt;signal.h&gt;<\/p>\n<p>void create_daemon() {<br \/>\n    pid_t pid &#061; fork();<\/p>\n<p>    if (pid &lt; 0) {<br \/>\n        perror(&#034;fork\u5931\u8d25&#034;);<br \/>\n        exit(1);<br \/>\n    } else if (pid &gt; 0) {<br \/>\n        \/\/ \u7236\u8fdb\u7a0b\u9000\u51fa<br \/>\n        exit(0);<br \/>\n    }<\/p>\n<p>    \/\/ \u5b50\u8fdb\u7a0b\u7ee7\u7eed<\/p>\n<p>    \/\/ 1. \u521b\u5efa\u65b0\u4f1a\u8bdd&#xff0c;\u8131\u79bb\u7ec8\u7aef<br \/>\n    setsid();<\/p>\n<p>    \/\/ 2. \u6539\u53d8\u5de5\u4f5c\u76ee\u5f55\u5230\u6839\u76ee\u5f55<br \/>\n    chdir(&#034;\/&#034;);<\/p>\n<p>    \/\/ 3. \u91cd\u8bbe\u6587\u4ef6\u6743\u9650\u63a9\u7801<br \/>\n    umask(0);<\/p>\n<p>    \/\/ 4. \u5173\u95ed\u4e0d\u9700\u8981\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26<br \/>\n    for (int i &#061; 0; i &lt; 3; i&#043;&#043;) {<br \/>\n        close(i);<br \/>\n    }<\/p>\n<p>    \/\/ 5. \u91cd\u5b9a\u5411\u6807\u51c6\u8f93\u5165\u8f93\u51fa\u9519\u8bef<br \/>\n    open(&#034;\/dev\/null&#034;, O_RDWR);  \/\/ stdin<br \/>\n    dup(0);                     \/\/ stdout<br \/>\n    dup(0);                     \/\/ stderr<\/p>\n<p>    \/\/ 6. \u5ffd\u7565\u67d0\u4e9b\u4fe1\u53f7<br \/>\n    signal(SIGCHLD, SIG_IGN);<br \/>\n    signal(SIGHUP, SIG_IGN);<\/p>\n<p>    \/\/ \u5b88\u62a4\u8fdb\u7a0b\u4e3b\u5faa\u73af<br \/>\n    while (1) {<br \/>\n        \/\/ \u6267\u884c\u5b88\u62a4\u4efb\u52a1<br \/>\n        sleep(10);<br \/>\n    }<br \/>\n}<\/p>\n<p>int main() {<br \/>\n    create_daemon();<br \/>\n    return 0;<br \/>\n}<\/p>\n<h3>\u516b\u3001\u6027\u80fd\u76d1\u63a7\u4e0e\u8c03\u8bd5<\/h3>\n<h4>8.1 \u8fdb\u7a0b\u8d44\u6e90\u76d1\u63a7<\/h4>\n<p># 1. \u5b9e\u65f6\u76d1\u63a7<br \/>\ntop -p 1234              # \u76d1\u63a7\u7279\u5b9a\u8fdb\u7a0b<br \/>\ntop -u username          # \u76d1\u63a7\u7279\u5b9a\u7528\u6237\u8fdb\u7a0b<\/p>\n<p># 2. \u67e5\u770b\u8fdb\u7a0b\u6253\u5f00\u7684\u6587\u4ef6<br \/>\nlsof -p 1234             # \u67e5\u770b\u8fdb\u7a0b\u6253\u5f00\u7684\u6587\u4ef6<br \/>\nlsof -c nginx            # \u67e5\u770bnginx\u6253\u5f00\u7684\u6587\u4ef6<\/p>\n<p># 3. \u67e5\u770b\u8fdb\u7a0b\u5185\u5b58\u6620\u5c04<br \/>\npmap 1234                # \u663e\u793a\u8fdb\u7a0b\u5185\u5b58\u6620\u5c04<br \/>\ncat \/proc\/1234\/maps      # \u66f4\u8be6\u7ec6\u7684\u5185\u5b58\u6620\u5c04<\/p>\n<p># 4. \u67e5\u770b\u8fdb\u7a0b\u72b6\u6001<br \/>\ncat \/proc\/1234\/status    # \u8fdb\u7a0b\u72b6\u6001\u4fe1\u606f<br \/>\ncat \/proc\/1234\/stat      # \u8fdb\u7a0b\u7edf\u8ba1\u4fe1\u606f<\/p>\n<h4>8.2 \u6027\u80fd\u5206\u6790\u5de5\u5177<\/h4>\n<p># 1. \u7cfb\u7edf\u7ea7\u76d1\u63a7<br \/>\nvmstat 1                 # \u6bcf\u79d2\u663e\u793a\u7cfb\u7edf\u72b6\u6001<br \/>\nmpstat 1                 # CPU\u4f7f\u7528\u60c5\u51b5<br \/>\niostat 1                 # I\/O\u4f7f\u7528\u60c5\u51b5<\/p>\n<p># 2. \u8fdb\u7a0b\u7ea7\u76d1\u63a7<br \/>\npidstat 1                # \u8fdb\u7a0b\u8d44\u6e90\u4f7f\u7528\u7edf\u8ba1<br \/>\nstrace -p 1234           # \u8ddf\u8e2a\u7cfb\u7edf\u8c03\u7528<\/p>\n<p># 3. \u5185\u5b58\u5206\u6790<br \/>\nvalgrind &#8211;tool&#061;memcheck .\/program  # \u5185\u5b58\u6cc4\u6f0f\u68c0\u6d4b<\/p>\n<h3>\u4e5d\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>9.1 \u8fdb\u7a0b\u521b\u5efa\u5931\u8d25<\/h4>\n<p>\/\/ \u9519\u8bef&#xff1a;Resource temporarily unavailable<br \/>\n\/\/ \u539f\u56e0&#xff1a;\u8fbe\u5230\u8fdb\u7a0b\u6570\u9650\u5236<\/p>\n<p>\/\/ \u89e3\u51b3\u65b9\u6848&#xff1a;<br \/>\n\/\/ 1. \u67e5\u770b\u5f53\u524d\u9650\u5236<br \/>\nulimit -u<\/p>\n<p>\/\/ 2. \u4fee\u6539\u9650\u5236&#xff08;\u4e34\u65f6&#xff09;<br \/>\nulimit -u 10000<\/p>\n<p>\/\/ 3. \u67e5\u770b\u7cfb\u7edf\u603b\u9650\u5236<br \/>\ncat \/proc\/sys\/kernel\/pid_max<\/p>\n<p>\/\/ 4. \u68c0\u67e5\u662f\u5426\u5b58\u5728\u50f5\u5c38\u8fdb\u7a0b\u5360\u7528\u8d44\u6e90<br \/>\nps aux | grep &#034;defunct&#034;<\/p>\n<h4>9.2 \u8fdb\u7a0b\u5361\u6b7b\u5206\u6790<\/h4>\n<p># 1. \u67e5\u770b\u8fdb\u7a0b\u72b6\u6001<br \/>\nps aux | grep process_name<\/p>\n<p># 2. \u67e5\u770b\u8fdb\u7a0b\u5806\u6808<br \/>\npstack 1234<\/p>\n<p># 3. \u751f\u6210core dump&#xff08;\u9700\u63d0\u524d\u8bbe\u7f6e&#xff09;<br \/>\nulimit -c unlimited<br \/>\nkill -ABRT 1234<\/p>\n<p># 4. \u4f7f\u7528gdb\u5206\u6790core\u6587\u4ef6<br \/>\ngdb .\/program core.1234<\/p>\n<h4>9.3 \u907f\u514d\u5e38\u89c1\u9519\u8bef<\/h4>\n<p>\/\/ \u9519\u8bef1&#xff1a;\u5fd8\u8bb0\u68c0\u67e5fork\u8fd4\u56de\u503c<br \/>\npid_t pid &#061; fork();<br \/>\n\/\/ \u6b63\u786e&#xff1a;\u603b\u662f\u68c0\u67e5\u8fd4\u56de\u503c<br \/>\nif (pid &lt; 0) {<br \/>\n    perror(&#034;fork failed&#034;);<br \/>\n    \/\/ \u5904\u7406\u9519\u8bef<br \/>\n}<\/p>\n<p>\/\/ \u9519\u8bef2&#xff1a;\u4ea7\u751f\u50f5\u5c38\u8fdb\u7a0b<br \/>\nif (fork() &#061;&#061; 0) {<br \/>\n    exit(0);<br \/>\n}<br \/>\n\/\/ \u6b63\u786e&#xff1a;\u7236\u8fdb\u7a0b\u56de\u6536\u5b50\u8fdb\u7a0b<br \/>\nwait(NULL);<\/p>\n<p>\/\/ \u9519\u8bef3&#xff1a;fork\u540e\u672a\u5904\u7406\u6587\u4ef6\u63cf\u8ff0\u7b26<br \/>\nint fd &#061; open(&#034;file.txt&#034;, O_RDWR);<br \/>\nfork();<br \/>\n\/\/ \u6b63\u786e&#xff1a;\u7236\u5b50\u8fdb\u7a0b\u53ef\u80fd\u9700\u8981\u5206\u522b\u5904\u7406\u6587\u4ef6\u6307\u9488<\/p>\n<h3>\u5341\u3001\u603b\u7ed3\u4e0e\u6700\u4f73\u5b9e\u8df5<\/h3>\n<h4>10.1 \u6838\u5fc3\u8981\u70b9\u56de\u987e<\/h4>\n<li>\n<p>\u8fdb\u7a0b\u662f\u52a8\u6001\u7684\u7a0b\u5e8f\u6267\u884c\u5b9e\u4f8b<\/p>\n<\/li>\n<li>\n<p>\u6bcf\u4e2a\u8fdb\u7a0b\u6709\u72ec\u7acb\u76844GB\u865a\u62df\u5730\u5740\u7a7a\u95f4<\/p>\n<\/li>\n<li>\n<p>fork\u521b\u5efa\u5b50\u8fdb\u7a0b&#xff0c;\u590d\u5236\u7236\u8fdb\u7a0b\u7684\u5730\u5740\u7a7a\u95f4<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u7a0b\u67097\u79cd\u72b6\u6001&#xff0c;\u9700\u8981\u6b63\u786e\u7ba1\u7406<\/p>\n<\/li>\n<li>\n<p>\u8c03\u5ea6\u7b97\u6cd5\u51b3\u5b9aCPU\u65f6\u95f4\u7684\u5206\u914d<\/p>\n<\/li>\n<h4>10.2 \u6700\u4f73\u5b9e\u8df5<\/h4>\n<li>\n<p>\u603b\u662f\u68c0\u67e5\u7cfb\u7edf\u8c03\u7528\u8fd4\u56de\u503c<\/p>\n<\/li>\n<li>\n<p>\u53ca\u65f6\u56de\u6536\u5b50\u8fdb\u7a0b&#xff0c;\u907f\u514d\u50f5\u5c38\u8fdb\u7a0b<\/p>\n<\/li>\n<li>\n<p>\u5408\u7406\u8bbe\u7f6e\u8fdb\u7a0b\u4f18\u5148\u7ea7<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u5408\u9002\u7684\u8c03\u5ea6\u7b56\u7565<\/p>\n<\/li>\n<li>\n<p>\u76d1\u63a7\u8fdb\u7a0b\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5<\/p>\n<\/li>\n<h4>10.3 \u9762\u8bd5\u5e38\u89c1\u95ee\u9898<\/h4>\n<li>\n<p>\u8fdb\u7a0b\u548c\u7ebf\u7a0b\u7684\u533a\u522b&#xff1f;<\/p>\n<\/li>\n<li>\n<p>fork\u548cexec\u7684\u533a\u522b&#xff1f;<\/p>\n<\/li>\n<li>\n<p>\u4ec0\u4e48\u662f\u50f5\u5c38\u8fdb\u7a0b&#xff1f;\u5982\u4f55\u907f\u514d&#xff1f;<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u5305\u542b\u54ea\u4e9b\u90e8\u5206&#xff1f;<\/p>\n<\/li>\n<li>\n<p>Linux\u6709\u54ea\u4e9b\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5&#xff1f;<\/p>\n<\/li>\n<hr \/>\n<h3>\u7acb\u5373\u52a8\u624b&#xff01;<\/h3>\n<p>\u7406\u8bba\u77e5\u8bc6\u9700\u8981\u5b9e\u8df5\u5de9\u56fa&#xff1a;<\/p>\n<li>\n<p>\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f&#xff0c;\u521b\u5efa\u591a\u4e2a\u5b50\u8fdb\u7a0b\u5e76\u89c2\u5bdf\u5b83\u4eec\u7684\u72b6\u6001\u53d8\u5316<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684\u8fdb\u7a0b\u76d1\u63a7\u5de5\u5177<\/p>\n<\/li>\n<li>\n<p>\u5206\u6790\u73b0\u6709\u7a0b\u5e8f\u7684\u8fdb\u7a0b\u884c\u4e3a<\/p>\n<\/li>\n<li>\n<p>\u5c1d\u8bd5\u4f18\u5316\u4e00\u4e2a\u7a0b\u5e8f\u7684\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565<\/p>\n<\/li>\n<p>\u8bb0\u4f4f&#xff1a;\u7406\u89e3\u8fdb\u7a0b\u662f\u7406\u89e3\u64cd\u4f5c\u7cfb\u7edf\u7684\u7b2c\u4e00\u6b65&#xff0c;\u4e5f\u662f\u7f16\u5199\u9ad8\u6027\u80fd\u3001\u7a33\u5b9a\u7a0b\u5e8f\u7684\u57fa\u7840\u3002<\/p>\n<hr \/>\n<p>\u4e92\u52a8\u95ee\u9898&#xff1a;<\/p>\n<p>\u4f60\u5728\u8fdb\u7a0b\u7f16\u7a0b\u4e2d\u9047\u5230\u8fc7\u4ec0\u4e48\u6709\u8da3\u7684\u95ee\u9898&#xff1f;<\/p>\n<p>\u6709\u54ea\u4e9b\u8fdb\u7a0b\u7ba1\u7406\u7684\u5b9e\u7528\u6280\u5de7&#xff1f;<\/p>\n<p>\u5728\u8bc4\u8bba\u533a\u5206\u4eab\u4f60\u7684\u7ecf\u9a8c&#xff0c;\u6211\u4eec\u4e00\u8d77\u5b66\u4e60\u8fdb\u6b65&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u8fdb\u7a0b\u5b8c\u5168\u6307\u5357&#xff1a;\u4ece\u7a0b\u5e8f\u5230PCB\u7684\u6df1\u5ea6\u89e3\u6790\u7406\u89e3\u8fdb\u7a0b\u662f\u7406\u89e3\u64cd\u4f5c\u7cfb\u7edf\u7684\u5173\u952e\u3002\u672c\u6587\u5e26\u4f60\u4ece\u7a0b\u5e8f\u52a0\u8f7d\u5230\u8fdb\u7a0b\u8c03\u5ea6&#xff0c;\u5f7b\u5e95\u638c\u63e1Linux\u8fdb\u7a0b\u7ba1\u7406\u7684\u6240\u6709\u6838\u5fc3\u6982\u5ff5\u3002\u4e00\u3001\u7a0b\u5e8f vs \u8fdb\u7a0b&#xff1a;\u9759\u6001\u4e0e\u52a8\u6001\u7684\u54f2\u5b661.1 \u57fa\u672c\u6982\u5ff5\u6f84\u6e05\/\/ \u7a0b\u5e8f&#xff1a;\u9759\u6001\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6<br \/>\n\/\/ \u793a\u4f8b&#xff1a;\u7f16\u8bd1\u540e\u7684a.out<br \/>\n$ gcc hello.c -o hello  # \u751f\u6210\u7a0b\u5e8f\u6587\u4ef6\/\/ \u8fdb\u7a0b&#xff1a;\u7a0b\u5e8f\u7684\u4e00\u6b21\u6267\u884c\u5b9e\u4f8b<br \/>\n$ .\/hello &amp;    <\/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,219,190,43,44],"topic":[],"class_list":["post-74842","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-219","tag-190","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>0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f-\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b - \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\/74842.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f-\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Linux\u8fdb\u7a0b\u5b8c\u5168\u6307\u5357&#xff1a;\u4ece\u7a0b\u5e8f\u5230PCB\u7684\u6df1\u5ea6\u89e3\u6790\u7406\u89e3\u8fdb\u7a0b\u662f\u7406\u89e3\u64cd\u4f5c\u7cfb\u7edf\u7684\u5173\u952e\u3002\u672c\u6587\u5e26\u4f60\u4ece\u7a0b\u5e8f\u52a0\u8f7d\u5230\u8fdb\u7a0b\u8c03\u5ea6&#xff0c;\u5f7b\u5e95\u638c\u63e1Linux\u8fdb\u7a0b\u7ba1\u7406\u7684\u6240\u6709\u6838\u5fc3\u6982\u5ff5\u3002\u4e00\u3001\u7a0b\u5e8f vs \u8fdb\u7a0b&#xff1a;\u9759\u6001\u4e0e\u52a8\u6001\u7684\u54f2\u5b661.1 \u57fa\u672c\u6982\u5ff5\u6f84\u6e05\/\/ \u7a0b\u5e8f&#xff1a;\u9759\u6001\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6 \/\/ \u793a\u4f8b&#xff1a;\u7f16\u8bd1\u540e\u7684a.out $ gcc hello.c -o hello # \u751f\u6210\u7a0b\u5e8f\u6587\u4ef6\/\/ \u8fdb\u7a0b&#xff1a;\u7a0b\u5e8f\u7684\u4e00\u6b21\u6267\u884c\u5b9e\u4f8b $ .\/hello &amp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/74842.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-10T11:41:06+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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/74842.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/74842.html\",\"name\":\"0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f-\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-10T11:41:06+00:00\",\"dateModified\":\"2026-02-10T11:41:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/74842.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/74842.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/74842.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f--\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b\"}]},{\"@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":"0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f-\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b - \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\/74842.html","og_locale":"zh_CN","og_type":"article","og_title":"0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f-\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Linux\u8fdb\u7a0b\u5b8c\u5168\u6307\u5357&#xff1a;\u4ece\u7a0b\u5e8f\u5230PCB\u7684\u6df1\u5ea6\u89e3\u6790\u7406\u89e3\u8fdb\u7a0b\u662f\u7406\u89e3\u64cd\u4f5c\u7cfb\u7edf\u7684\u5173\u952e\u3002\u672c\u6587\u5e26\u4f60\u4ece\u7a0b\u5e8f\u52a0\u8f7d\u5230\u8fdb\u7a0b\u8c03\u5ea6&#xff0c;\u5f7b\u5e95\u638c\u63e1Linux\u8fdb\u7a0b\u7ba1\u7406\u7684\u6240\u6709\u6838\u5fc3\u6982\u5ff5\u3002\u4e00\u3001\u7a0b\u5e8f vs \u8fdb\u7a0b&#xff1a;\u9759\u6001\u4e0e\u52a8\u6001\u7684\u54f2\u5b661.1 \u57fa\u672c\u6982\u5ff5\u6f84\u6e05\/\/ \u7a0b\u5e8f&#xff1a;\u9759\u6001\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6 \/\/ \u793a\u4f8b&#xff1a;\u7f16\u8bd1\u540e\u7684a.out $ gcc hello.c -o hello # \u751f\u6210\u7a0b\u5e8f\u6587\u4ef6\/\/ \u8fdb\u7a0b&#xff1a;\u7a0b\u5e8f\u7684\u4e00\u6b21\u6267\u884c\u5b9e\u4f8b $ .\/hello &amp;","og_url":"https:\/\/www.wsisp.com\/helps\/74842.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-10T11:41:06+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/74842.html","url":"https:\/\/www.wsisp.com\/helps\/74842.html","name":"0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f-\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-10T11:41:06+00:00","dateModified":"2026-02-10T11:41:06+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/74842.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/74842.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/74842.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"0\u57fa\u7840\u5b66\u5d4c\u5165\u5f0f--\u5168\u7f51\u6700\u8be6\u7ec6Linux\u5f00\u53d1\u6307\u5357\uff1a\u4e00\u7bc7\u6587\u7ae0\u5e26\u4f60\u5b66\u61c2Linux\u8fdb\u7a0b"}]},{"@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\/74842","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=74842"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/74842\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=74842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=74842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=74842"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=74842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}