{"id":59108,"date":"2026-01-13T12:19:55","date_gmt":"2026-01-13T04:19:55","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/59108.html"},"modified":"2026-01-13T12:19:55","modified_gmt":"2026-01-13T04:19:55","slug":"%e3%80%90linux%e3%80%91%e8%bf%9b%e7%a8%8b%e8%b0%83%e5%ba%a6%e7%ae%97%e6%b3%95%e3%80%81%e8%bf%9b%e7%a8%8b%e5%88%87%e6%8d%a2%e3%80%81%e7%8e%af%e5%a2%83%e5%8f%98%e9%87%8f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/59108.html","title":{"rendered":"\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf"},"content":{"rendered":"<p><span style=\"color:#0d0016\">\u524d\u8a00<\/span><\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u805a\u7126 Linux \u7684\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u4e0e\u73af\u5883\u53d8\u91cf&#xff1a;\u62c6\u89e3\u8c03\u5ea6\u89c4\u5219\u5982\u4f55\u5206\u914d CPU \u8d44\u6e90&#xff0c;\u89e3\u6790\u8fdb\u7a0b\u5207\u6362\u7684\u5e95\u5c42\u6b65\u9aa4&#xff0c;\u68b3\u7406\u73af\u5883\u53d8\u91cf\u5bf9\u7a0b\u5e8f\u8fd0\u884c\u7684\u5f71\u54cd&#xff0c;\u5e2e\u4f60\u7406\u6e05\u8fd9\u4e9b\u673a\u5236\u5728\u7cfb\u7edf\u4e2d\u7684\u6838\u5fc3\u4f5c\u7528\u3002<\/p>\n<\/p>\n<p>\u2699\ufe0f Linux \u8fdb\u7a0b\u7bc7<\/p>\n<p>\u3010 \u51af\u8bfa\u4f9d\u66fc\u4f53\u7cfb &#043; \u64cd\u4f5c\u7cfb\u7edf \u3011<\/p>\n<p>\u3010 \u8fdb\u7a0b\u6982\u5ff5 &#043; PID &#043; fork\u51fd\u6570 \u3011<\/p>\n<p>\u3010 \u8fdb\u7a0b\u72b6\u6001 \u3011<\/p>\n<p>\u3010 \u8fdb\u7a0b\u4f18\u5148\u7ea7 \u3011<\/p>\n<\/p>\n<hr \/>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E8%BF%9B%E7%A8%8B%E8%B0%83%E5%BA%A6-toc\" style=\"margin-left:0px\">\u4e00\u3001\u8fdb\u7a0b\u8c03\u5ea6<\/p>\n<p id=\"%E2%85%A0%E3%80%81%E8%BF%9B%E7%A8%8B%E8%B0%83%E5%BA%A6%E6%A6%82%E5%BF%B5-toc\" style=\"margin-left:80px\">\u00a0\u2160\u3001\u8fdb\u7a0b\u8c03\u5ea6\u6982\u5ff5<\/p>\n<p id=\"%C2%A0%E2%85%A1%E3%80%81%E4%BD%8D%E5%9B%BE%EF%BC%88bitmap%EF%BC%89%E4%B8%AD%E4%BD%8D%E7%9A%84%E5%AE%9A%E4%BD%8D%E4%B8%8E%E7%8A%B6%E6%80%81%E5%88%A4%E6%96%AD-toc\" style=\"margin-left:80px\">\u00a0\u2161\u3001\u4f4d\u56fe&#xff08;bitmap&#xff09;\u4e2d\u4f4d\u7684\u5b9a\u4f4d\u4e0e\u72b6\u6001\u5224\u65ad<\/p>\n<p id=\"%C2%A0%E2%85%A2%E3%80%81%E8%BF%9B%E7%A8%8B%E8%B0%83%E5%BA%A6%E6%B5%81%E7%A8%8B-toc\" style=\"margin-left:80px\">\u00a0\u2162\u3001\u8fdb\u7a0b\u8c03\u5ea6\u6d41\u7a0b<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E8%BF%9B%E7%A8%8B%E5%88%87%E6%8D%A2-toc\" style=\"margin-left:0px\">\u4e8c\u3001\u8fdb\u7a0b\u5207\u6362<\/p>\n<p id=\"%E2%85%A0%E3%80%81%E8%BF%9B%E7%A8%8B%E5%88%87%E6%8D%A2%E6%A6%82%E5%BF%B5-toc\" style=\"margin-left:40px\">\u2160\u3001\u8fdb\u7a0b\u5207\u6362\u6982\u5ff5<\/p>\n<p id=\"%E2%85%A1%E3%80%81%E8%BF%9B%E7%A8%8B%E4%B8%8A%E4%B8%8B%E6%96%87%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F-toc\" style=\"margin-left:40px\">\u2161\u3001\u8fdb\u7a0b\u4e0a\u4e0b\u6587\u662f\u4ec0\u4e48&#xff1f;<\/p>\n<p id=\"%E2%85%A2%E3%80%81cpu%E4%B8%AD%E7%9A%84%E5%AF%84%E5%AD%98%E5%99%A8%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F-toc\" style=\"margin-left:40px\">\u2162\u3001cpu\u4e2d\u7684\u5bc4\u5b58\u5668\u662f\u4ec0\u4e48&#xff1f;<\/p>\n<p id=\"%E3%80%90%E9%97%AE%E9%A2%98%E3%80%91%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E5%87%BD%E6%95%B0%E8%BF%94%E5%9B%9E%E5%80%BC%E4%BC%9A%E8%A2%AB%E5%A4%96%E9%83%A8%E6%8B%BF%E5%88%B0%EF%BC%9F-toc\" style=\"margin-left:80px\">\u3010\u95ee\u9898\u3011&#xff1a;\u4e3a\u4ec0\u4e48\u51fd\u6570\u8fd4\u56de\u503c\u4f1a\u88ab\u5916\u90e8\u62ff\u5230&#xff1f;<\/p>\n<p id=\"%E3%80%90%E9%97%AE%E9%A2%98%E3%80%91%EF%BC%9A%E7%B3%BB%E7%BB%9F%E5%A6%82%E4%BD%95%E7%9F%A5%E9%81%93%E8%BF%9B%E7%A8%8B%E5%BD%93%E5%89%8D%E6%89%A7%E8%A1%8C%E5%88%B0%E5%93%AA%E8%A1%8C%E4%BB%A3%E7%A0%81%EF%BC%9F-toc\" style=\"margin-left:80px\">\u3010\u95ee\u9898\u3011&#xff1a;\u7cfb\u7edf\u5982\u4f55\u77e5\u9053\u8fdb\u7a0b\u5f53\u524d\u6267\u884c\u5230\u54ea\u884c\u4ee3\u7801&#xff1f;<\/p>\n<p id=\"%E2%85%A3%E3%80%81%E5%A6%82%E4%BD%95%E8%BF%9B%E8%A1%8C%E8%BF%9B%E7%A8%8B%E5%88%87%E6%8D%A2%EF%BC%9F-toc\" style=\"margin-left:40px\">\u2163\u3001\u5982\u4f55\u8fdb\u884c\u8fdb\u7a0b\u5207\u6362&#xff1f;<\/p>\n<p id=\"%E3%80%90%E5%B0%8F%E6%95%85%E4%BA%8B%E3%80%91%EF%BC%9A%E5%AD%A6%E7%94%9F%E5%BD%93%E5%85%B5-toc\" style=\"margin-left:80px\">\u3010\u5c0f\u6545\u4e8b\u3011&#xff1a;\u5b66\u751f\u5f53\u5175<\/p>\n<p id=\"%C2%A0%E3%80%90%E8%BF%9B%E7%A8%8B%E5%88%87%E6%8D%A2%E6%A0%B8%E5%BF%83%E6%AD%A5%E9%AA%A4%E3%80%91-toc\" style=\"margin-left:80px\">\u00a0\u3010\u8fdb\u7a0b\u5207\u6362\u6838\u5fc3\u6b65\u9aa4\u3011<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F-toc\" style=\"margin-left:0px\">\u4e09\u3001\u73af\u5883\u53d8\u91cf<\/p>\n<p id=\"%E2%85%A0%E3%80%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E6%A6%82%E5%BF%B5-toc\" style=\"margin-left:40px\">\u2160\u3001\u73af\u5883\u53d8\u91cf\u6982\u5ff5<\/p>\n<p id=\"%E9%97%AE%E9%A2%98%201%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E7%B3%BB%E7%BB%9F%E6%8C%87%E4%BB%A4%E4%B8%8D%E7%94%A8%E5%8A%A0.%2F%E5%B0%B1%E8%83%BD%E7%9B%B4%E6%8E%A5%E6%89%A7%E8%A1%8C%EF%BC%8C%E8%87%AA%E5%B7%B1%E5%86%99%E7%9A%84%E6%8C%87%E4%BB%A4%E5%8D%B4%E9%9C%80%E8%A6%81%EF%BC%9F-toc\" style=\"margin-left:80px\">\u95ee\u9898 1&#xff1a;\u4e3a\u4ec0\u4e48\u7cfb\u7edf\u6307\u4ee4\u4e0d\u7528\u52a0.\/\u5c31\u80fd\u76f4\u63a5\u6267\u884c&#xff0c;\u81ea\u5df1\u5199\u7684\u6307\u4ee4\u5374\u9700\u8981&#xff1f;<\/p>\n<p id=\"%E9%97%AE%E9%A2%98%202%EF%BC%9A%E5%A6%82%E4%BD%95%E6%9F%A5%E7%9C%8B%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%9F-toc\" style=\"margin-left:80px\">\u95ee\u9898 2&#xff1a;\u5982\u4f55\u67e5\u770b\u73af\u5883\u53d8\u91cf&#xff1f;<\/p>\n<p id=\"%E9%97%AE%E9%A2%98%203%EF%BC%9A%E5%A6%82%E4%BD%95%E8%AE%A9%E8%87%AA%E5%B7%B1%E5%86%99%E7%9A%84%E6%8C%87%E4%BB%A4%E4%B8%8D%E7%94%A8%E5%8A%A0.%2F%E5%B0%B1%E8%83%BD%E6%89%A7%E8%A1%8C%EF%BC%9F-toc\" style=\"margin-left:80px\">\u95ee\u9898 3&#xff1a;\u5982\u4f55\u8ba9\u81ea\u5df1\u5199\u7684\u6307\u4ee4\u4e0d\u7528\u52a0.\/\u5c31\u80fd\u6267\u884c&#xff1f;<\/p>\n<p id=\"%E9%97%AE%E9%A2%98%204%EF%BC%9A%E4%B8%8D%E5%B0%8F%E5%BF%83%E8%A6%86%E7%9B%96%E4%BA%86%E7%B3%BB%E7%BB%9F%E6%8C%87%E4%BB%A4%E7%9A%84%E9%BB%98%E8%AE%A4%E6%90%9C%E7%B4%A2%E8%B7%AF%E5%BE%84%EF%BC%8C%E6%80%8E%E4%B9%88%E6%81%A2%E5%A4%8D%EF%BC%9F-toc\" style=\"margin-left:80px\">\u95ee\u9898 4&#xff1a;\u4e0d\u5c0f\u5fc3\u8986\u76d6\u4e86\u7cfb\u7edf\u6307\u4ee4\u7684\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84&#xff0c;\u600e\u4e48\u6062\u590d&#xff1f;<\/p>\n<p id=\"%E9%97%AE%E9%A2%98%205%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E7%99%BB%E5%BD%95%E7%B3%BB%E7%BB%9F%E5%90%8E%E4%BC%9A%E7%9B%B4%E6%8E%A5%E8%BF%9B%E5%85%A5%E5%AE%B6%E7%9B%AE%E5%BD%95%EF%BC%9F-toc\" style=\"margin-left:80px\">\u95ee\u9898 5&#xff1a;\u4e3a\u4ec0\u4e48\u767b\u5f55\u7cfb\u7edf\u540e\u4f1a\u76f4\u63a5\u8fdb\u5165\u5bb6\u76ee\u5f55&#xff1f;<\/p>\n<p id=\"%E9%97%AE%E9%A2%98%206%EF%BC%9Aecho%20%24SHELL%E8%BE%93%E5%87%BA%2Fbin%2Fbash%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%EF%BC%9F-toc\" style=\"margin-left:80px\">\u95ee\u9898 6&#xff1a;echo $SHELL\u8f93\u51fa\/bin\/bash\u662f\u4ec0\u4e48\u610f\u601d&#xff1f;<\/p>\n<p id=\"%E9%97%AE%E9%A2%98%207%EF%BC%9A%24SHELL%E7%9A%84%E6%A0%B8%E5%BF%83%E4%BD%9C%E7%94%A8%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F-toc\" style=\"margin-left:80px\">\u95ee\u9898 7&#xff1a;$SHELL\u7684\u6838\u5fc3\u4f5c\u7528\u662f\u4ec0\u4e48&#xff1f;<\/p>\n<p id=\"env%E5%91%BD%E4%BB%A4-toc\" style=\"margin-left:80px\">env\u547d\u4ee4<\/p>\n<p id=\"%E3%80%90%E6%A0%B8%E5%BF%83%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%A1%A8%E6%A0%BC%E3%80%91-toc\" style=\"margin-left:80px\">\u3010\u6838\u5fc3\u73af\u5883\u53d8\u91cf\u8868\u683c\u3011<\/p>\n<p id=\"%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%A6%82%E4%BD%95%E8%A2%AB%E7%BB%84%E7%BB%87%EF%BC%9F-toc\" style=\"margin-left:80px\">\u73af\u5883\u53d8\u91cf\u5982\u4f55\u88ab\u7ec4\u7ec7&#xff1f;<\/p>\n<p id=\"%E2%85%A1%E3%80%81%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8F%82%E6%95%B0-toc\" style=\"margin-left:40px\">\u2161\u3001\u547d\u4ee4\u884c\u53c2\u6570<\/p>\n<p id=\"Q%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E8%AE%A9%20main%20%E5%87%BD%E6%95%B0%E6%94%AF%E6%8C%81%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8F%82%E6%95%B0%EF%BC%88argc%2Fargv%EF%BC%89%EF%BC%9F-toc\" style=\"margin-left:80px\">Q&#xff1a;\u4e3a\u4ec0\u4e48\u8981\u8ba9 main \u51fd\u6570\u652f\u6301\u547d\u4ee4\u884c\u53c2\u6570&#xff08;argc\/argv&#xff09;&#xff1f;<\/p>\n<p id=\"C%EF%BC%9A%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%8F%82%E6%95%B0-toc\" style=\"margin-left:80px\">C&#xff1a;\u73af\u5883\u53d8\u91cf\u53c2\u6570<\/p>\n<p id=\"%E2%85%A2%E3%80%81%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%92%8C%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%9F-toc\" style=\"margin-left:40px\">\u2162\u3001\u5982\u4f55\u83b7\u53d6\u548c\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf&#xff1f;<\/p>\n<p id=\"G%EF%BC%9A%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%9F-toc\" style=\"margin-left:80px\">G&#xff1a;\u5982\u4f55\u83b7\u53d6\u73af\u5883\u53d8\u91cf&#xff1f;<\/p>\n<p id=\"S%EF%BC%9A%E5%A6%82%E4%BD%95%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%9F-toc\" style=\"margin-left:80px\">S&#xff1a;\u5982\u4f55\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf&#xff1f;<\/p>\n<p id=\"1%E3%80%81%E4%B8%B4%E6%97%B6%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%88%E4%BB%85%E5%BD%93%E5%89%8D%E7%BB%88%E7%AB%AF%E4%BC%9A%E8%AF%9D%E7%94%9F%E6%95%88%EF%BC%89-toc\" style=\"margin-left:80px\">1\u3001\u4e34\u65f6\u6dfb\u52a0\u73af\u5883\u53d8\u91cf&#xff08;\u4ec5\u5f53\u524d\u7ec8\u7aef\u4f1a\u8bdd\u751f\u6548&#xff09;<\/p>\n<p id=\"2%E3%80%81%E6%B0%B8%E4%B9%85%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%88%E6%89%80%E6%9C%89%E7%BB%88%E7%AB%AF%E4%BC%9A%E8%AF%9D%E7%94%9F%E6%95%88%EF%BC%89-toc\" style=\"margin-left:80px\">2\u3001\u6c38\u4e45\u6dfb\u52a0\u73af\u5883\u53d8\u91cf&#xff08;\u6240\u6709\u7ec8\u7aef\u4f1a\u8bdd\u751f\u6548&#xff09;<\/p>\n<p id=\"3%E3%80%81%E4%B8%B4%E6%97%B6%E5%8F%96%E6%B6%88%EF%BC%88%E4%BB%85%E5%BD%93%E5%89%8D%E7%BB%88%E7%AB%AF%E7%94%9F%E6%95%88%EF%BC%8C%E5%85%B3%E9%97%AD%E7%BB%88%E7%AB%AF%E5%8D%B3%E5%A4%B1%E6%95%88%EF%BC%89-toc\" style=\"margin-left:80px\">3\u3001\u4e34\u65f6\u53d6\u6d88&#xff08;\u4ec5\u5f53\u524d\u7ec8\u7aef\u751f\u6548&#xff0c;\u5173\u95ed\u7ec8\u7aef\u5373\u5931\u6548&#xff09;<\/p>\n<p id=\"4%E3%80%81%E6%B0%B8%E4%B9%85%E5%8F%96%E6%B6%88%EF%BC%88%E6%89%80%E6%9C%89%E7%BB%88%E7%AB%AF%E7%94%9F%E6%95%88%EF%BC%8C%E9%9C%80%E5%88%A0%E9%99%A4%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E5%AE%9A%E4%B9%89%EF%BC%89-toc\" style=\"margin-left:80px\">4\u3001\u6c38\u4e45\u53d6\u6d88&#xff08;\u6240\u6709\u7ec8\u7aef\u751f\u6548&#xff0c;\u9700\u5220\u9664\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u5b9a\u4e49&#xff09;<\/p>\n<p id=\"%E2%85%A3%E3%80%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E7%9A%84%E7%BB%A7%E6%89%BF%E6%80%A7%20%2B%20%E5%85%A8%E5%B1%80%E5%B1%9E%E6%80%A7%20%2B%E6%9C%AC%E5%9C%B0%E5%8F%98%E9%87%8F-toc\" style=\"margin-left:40px\">\u2163\u3001\u73af\u5883\u53d8\u91cf\u7684\u7ee7\u627f\u6027 &#043; \u5168\u5c40\u5c5e\u6027 &#043;\u672c\u5730\u53d8\u91cf<\/p>\n<p id=\"1%E3%80%81%E7%BB%A7%E6%89%BF%E6%80%A7-toc\" style=\"margin-left:80px\">1\u3001\u7ee7\u627f\u6027<\/p>\n<p id=\"2%E3%80%81%E5%85%A8%E5%B1%80%E5%B1%9E%E6%80%A7-toc\" style=\"margin-left:80px\">2\u3001\u5168\u5c40\u5c5e\u6027<\/p>\n<p id=\"Q%EF%BC%9A%E4%B8%BA%E5%95%A5%E5%AD%90%E8%BF%9B%E7%A8%8B%E4%BF%AE%E6%94%B9%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E4%B8%8D%E5%BD%B1%E5%93%8D%E7%88%B6%E8%BF%9B%E7%A8%8B%EF%BC%9F-toc\" style=\"margin-left:80px\">Q&#xff1a;\u4e3a\u5565\u5b50\u8fdb\u7a0b\u4fee\u6539\u73af\u5883\u53d8\u91cf\u4e0d\u5f71\u54cd\u7236\u8fdb\u7a0b&#xff1f;<\/p>\n<p id=\"3%E3%80%81%E6%9C%AC%E5%9C%B0%E5%8F%98%E9%87%8F-toc\" style=\"margin-left:80px\">3\u3001\u672c\u5730\u53d8\u91cf<\/p>\n<p id=\"4%E3%80%81%E5%86%85%E5%BB%BA%E5%91%BD%E4%BB%A4%E5%92%8C%E5%B8%B8%E8%A7%84%E5%91%BD%E4%BB%A4-toc\" style=\"margin-left:80px\">4\u3001\u5185\u5efa\u547d\u4ee4\u548c\u5e38\u89c4\u547d\u4ee4<\/p>\n<p id=\"%E3%80%90%E6%A8%A1%E6%8B%9Fcd%E5%86%85%E5%BB%BA%E6%8C%87%E4%BB%A4%E3%80%91-toc\" style=\"margin-left:80px\">\u3010\u6a21\u62dfcd\u5185\u5efa\u6307\u4ee4\u3011<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E4%B8%80%E3%80%81%E8%BF%9B%E7%A8%8B%E8%B0%83%E5%BA%A6\">\u4e00\u3001\u8fdb\u7a0b\u8c03\u5ea6<\/h2>\n<h4 id=\"%E2%85%A0%E3%80%81%E8%BF%9B%E7%A8%8B%E8%B0%83%E5%BA%A6%E6%A6%82%E5%BF%B5\" style=\"background-color:transparent\">\u2160\u3001\u8fdb\u7a0b\u8c03\u5ea6\u6982\u5ff5<\/h4>\n<p>\u8fdb\u7a0b\u8c03\u5ea6\u662f\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u6309\u7167\u4e00\u5b9a\u7684\u8c03\u5ea6\u7b97\u6cd5&#xff0c;\u4ece\u5c31\u7eea\u961f\u5217\u4e2d\u9009\u62e9\u4e00\u4e2a\u8fdb\u7a0b&#xff0c;\u5c06 CPU \u7684\u6267\u884c\u6743\u5206\u914d\u7ed9\u5b83&#xff0c;\u4f7f\u5176\u4ece\u5c31\u7eea\u72b6\u6001\u8f6c\u4e3a\u8fd0\u884c\u72b6\u6001\u6267\u884c\u7684\u8fc7\u7a0b&#xff0c;\u672c\u8d28\u662f\u89e3\u51b3 \u201cCPU \u8d44\u6e90\u5982\u4f55\u516c\u5e73\u3001\u9ad8\u6548\u5730\u5206\u914d\u7ed9\u591a\u4e2a\u5e76\u53d1\u8fdb\u7a0b\u201d \u7684\u95ee\u9898\u3002<\/p>\n<p>&#xff08;\u6ce8&#xff1a;\u201c\u8c03\u5ea6\u201d \u662f\u5206\u914d CPU \u6267\u884c\u6743\u7684\u6574\u4f53\u8fc7\u7a0b&#xff0c;\u800c \u201c\u8c03\u5ea6\u7b97\u6cd5\u201d \u662f\u652f\u6491\u8fd9\u4e00\u8fc7\u7a0b\u7684\u5177\u4f53\u89c4\u5219&#xff0c;\u51b3\u5b9a \u201c\u7ed9\u8c01\u5148\u5206\u914d\u3001\u5206\u914d\u591a\u4e45\u3001\u5565\u65f6\u5019\u8ba9\u4ed6\u628acpu\u8ba9\u51fa\u6765\u201d&#xff09;\u00a0<\/p>\n<p><span style=\"color:#fe2c24\">\u4e3a\u5565\u8981\u505a\u8fd9\u4e8b&#xff1f;<\/span>\u56e0\u4e3a CPU \u662f Linux \u91cc\u6700\u91d1\u8d35\u7684\u786c\u4ef6\u8d44\u6e90&#xff0c;\u4f46\u5b83 \u201c\u4e00\u5fc3\u4e0d\u80fd\u4e8c\u7528\u201d&#xff1b;\u53ef\u4f60\u5f00\u7684\u7ec8\u7aef\u3001\u540e\u53f0\u7684\u670d\u52a1\u3001\u8dd1\u7684\u7a0b\u5e8f&#xff0c;\u90fd\u7b49\u7740\u62a2 CPU \u5e72\u6d3b\u3002<\/p>\n<p><span style=\"color:#fe2c24\">\u8c03\u5ea6\u7684\u76ee\u6807&#xff1a;<\/span>\u8ba9\u8fd9\u4e9b\u4efb\u52a1 \u201c\u770b\u7740\u50cf\u540c\u65f6\u5728\u8dd1\u201d\u3001\u522b\u8ba9 CPU \u7a7a\u7740\u6d6a\u8d39&#xff0c;\u8fd8\u5f97\u4fdd\u8bc1\u9ad8\u4f18\u5148\u7ea7\u7684\u4efb\u52a1&#xff08;\u6bd4\u5982\u7cfb\u7edf\u670d\u52a1&#xff09;\u80fd\u5148\u62a2\u5230\u8d44\u6e90\u3002<\/p>\n<p>\u5b83\u662f Linux \u80fd\u5b9e\u73b0\u591a\u4efb\u52a1\u5e76\u53d1\u7684 \u201c\u5e55\u540e\u6307\u6325\u201d&#xff0c;\u4e5f\u662f\u628a \u201c\u4e00\u5806\u5f85\u6267\u884c\u7684\u4efb\u52a1\u201d \u548c \u201cCPU \u786c\u4ef6\u201d \u8fde\u8d77\u6765\u7684\u6838\u5fc3\u7ebd\u5e26\u3002<\/p>\n<h4 id=\"%C2%A0%E2%85%A1%E3%80%81%E4%BD%8D%E5%9B%BE%EF%BC%88bitmap%EF%BC%89%E4%B8%AD%E4%BD%8D%E7%9A%84%E5%AE%9A%E4%BD%8D%E4%B8%8E%E7%8A%B6%E6%80%81%E5%88%A4%E6%96%AD\">\u00a0\u2161\u3001\u4f4d\u56fe&#xff08;bitmap&#xff09;\u4e2d\u4f4d\u7684\u5b9a\u4f4d\u4e0e\u72b6\u6001\u5224\u65ad<\/h4>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041948-6965c7e4cc5c9.png\" \/>\u200b<\/p>\n<p> ### \u4f4d\u56fe&#xff08;bitmap&#xff09;\u4e2d\u4f4d\u7684\u5b9a\u4f4d\u4e0e\u72b6\u6001\u5224\u65ad<br \/>\n\u5728\u4f18\u5148\u7ea7\u8c03\u5ea6\u7684\u4f4d\u56fe\u673a\u5236\u4e2d&#xff0c;\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5b9a\u4f4d\u6307\u5b9a\u5e8f\u53f7N\u5bf9\u5e94\u7684\u6bd4\u7279\u4f4d&#xff0c;\u5e76\u5224\u65ad\u5176\u72b6\u6001&#xff1a;<br \/>\n1. \u5b9a\u4f4d\u6240\u5728char\u5143\u7d20&#xff1a;<br \/>\n    i &#061; N \/ (sizeof(char)*8)<br \/>\n   &#xff08;&#096;sizeof(char)*8&#096;\u662f\u5355\u4e2achar\u7684\u6bd4\u7279\u6570&#xff0c;\u901a\u5e38\u4e3a8&#xff1b;i\u8868\u793aN\u5bf9\u5e94\u7684\u6bd4\u7279\u4f4d\u6240\u5728\u7684char\u6570\u7ec4\u4e0b\u6807&#xff09;<\/p>\n<p>2. \u5b9a\u4f4dchar\u5185\u7684\u6bd4\u7279\u4f4d&#xff1a;<br \/>\n    pos &#061; N % (sizeof(char)*8)<br \/>\n   &#xff08;pos\u8868\u793aN\u5728\u5f53\u524dchar\u5143\u7d20\u4e2d\u7684\u5177\u4f53\u6bd4\u7279\u4f4d\u4e0b\u6807&#xff09;<\/p>\n<p>3. \u5224\u65ad\u6bd4\u7279\u4f4d\u662f\u5426\u7f6e1&#xff1a;<br \/>\n   \u5b9e\u9645\u64cd\u4f5c\u5e94\u4e3a  b.bits[i] &amp; (1 &lt;&lt; pos)<br \/>\n   &#xff08;\u901a\u8fc7\u4f4d\u8fd0\u7b97\u5224\u65ad\u8be5\u6bd4\u7279\u4f4d\u662f\u5426\u88ab\u6807\u8bb0\u4e3a1&#xff09; <\/p>\n<h4 id=\"%C2%A0%E2%85%A2%E3%80%81%E8%BF%9B%E7%A8%8B%E8%B0%83%E5%BA%A6%E6%B5%81%E7%A8%8B\" style=\"background-color:transparent\">\u00a0\u2162\u3001\u8fdb\u7a0b\u8c03\u5ea6\u6d41\u7a0b<\/h4>\n<p><span style=\"color:#fe2c24\">\u3010\u7b80\u7565\u7248\u8fd0\u884c\u961f\u5217\u7ed3\u6784\u4f53\u3011&#xff1a;<\/span><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041949-6965c7e5db5b0.png\" \/>\u200b<\/p>\n<hr \/>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041950-6965c7e63af56.png\" \/>\u200b<\/p>\n<p>\u8fd9\u4e24\u4e2a\u6307\u9488\u6570\u7ec4\u5206\u522b\u5b58\u50a8\u4e86140\u4e2a\u4f18\u5148\u7ea7\u5bf9\u5e94\u7684\u8fdb\u7a0b\u961f\u5217&#xff1b;<\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u666e\u901a\u4f18\u5148\u7ea7&#xff1a;<\/span>\u6211\u4eec\u53ea\u5173\u5fc3\u4e0b\u6807100&#xff5e;139&#xff08;\u6211\u4eec\u90fd\u662f\u666e\u901a\u7684\u4f18\u5148\u7ea7&#xff0c;\u60f3\u60f3nice\u503c\u7684\u53d6\u503c\u8303\u56f4&#xff0c;\u53ef\u4e0e\u4e4b\u5bf9\u5e94&#xff01;&#xff09;<\/li>\n<li><span style=\"color:#0d0016\">\u5b9e\u65f6\u4f18\u5148\u7ea7&#xff1a;<\/span>0&#xff5e;99&#xff08;\u4e0d\u5173\u5fc3&#xff09;<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041950-6965c7e66b5f9.png\" \/>\u200b<\/p>\n<p>\u8fdb\u7a0b\u88ab\u8c03\u5ea6\u65f6&#xff0c;\u4f1a\u6309\u7167\u4ece\u4e0a\u5230\u4e0b&#xff0c;\u4ece\u5de6\u5230\u53f3\u7684\u987a\u5e8f\u8fdb\u884c\u8f6e\u6362\u8c03\u5ea6&#xff0c;\u8fd9\u4e2a\u65f6\u5019\u6709\u4eba\u5c31\u4f1a\u6709\u7591\u95ee\u4e86&#xff0c;\u8fdb\u7a0b\u88ab\u8c03\u5ea6\u65f6&#xff0c;\u5982\u679c\u8c03\u5ea6\u8fc7\u7a0b\u4e2d\u7a81\u7136\u6709\u65b0\u8fdb\u7a0b\u63d2\u8fdb\u6765\u600e\u4e48\u529e&#xff1f;<\/p>\n<p>\u5176\u5b9e\u5b8c\u5168\u4e0d\u7528\u62c5\u5fc3\u65b0\u8fdb\u7a0b\u63d2\u5165\u4f1a\u6253\u4e71\u73b0\u6709\u961f\u5217\u79e9\u5e8f \u2014\u2014 \u8fd9\u7c7b\u65b0\u8fdb\u7a0b\u4f1a\u88ab\u7cbe\u51c6\u63d2\u5165\u5230waiting\u6570\u7ec4\u5bf9\u5e94\u4f18\u5148\u7ea7\u7684\u961f\u5217&#xff08;\u548crunning\u6570\u7ec4\u5b8c\u5168\u4e00\u6837&#xff09;&#xff0c;<span style=\"color:#ffd900\">\u5e76\u4e14\u662f\u76f4\u63a5\u8ffd\u52a0\u5230\u961f\u5c3e&#xff0c;\u4e0d\u4f1a\u63d2\u961f\u5230\u5f53\u524d\u6b63\u5728\u6392\u961f\u7684\u8fdb\u7a0b\u524d\u9762<\/span>&#xff0c;\u539f\u6709\u8fdb\u7a0b\u7684\u6392\u961f\u987a\u5e8f\u5b8c\u5168\u4e0d\u4f1a\u88ab\u6539\u52a8\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041951-6965c7e708e39.png\" \/>\u200b<\/p>\n<p>\u8c03\u5ea6\u7684\u987a\u5e8f\u662f\u5148\u628arunning\u6570\u7ec4\u91cc\u7684\u8fdb\u7a0b\u8c03\u5ea6\u5b8c&#xff0c;\u518d\u53bb\u8c03\u5ea6waiting\u6570\u7ec4\u91cc\u7684\u8fdb\u7a0b\u3002<\/p>\n<hr \/>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041951-6965c7e75fba5.png\" \/>\u200b<\/p>\n<p>\u8fd9\u91cc\u7684run\u548cwait\u4e24\u4e2a\u6307\u9488&#xff0c;\u5c31\u662f\u7528\u6765\u7ba1\u7406\u8fd9\u4e24\u4e2a\u6570\u7ec4\u7684&#xff1a;run\u6307\u9488\u8d1f\u8d23\u6307\u5411running\u6570\u7ec4&#xff0c;wait\u6307\u9488\u8d1f\u8d23\u6307\u5411waiting\u6570\u7ec4\u3002\u7b49\u8981\u5207\u6362\u8c03\u5ea6\u7684\u6570\u7ec4\u65f6&#xff0c;\u4e0d\u7528\u52a8\u6570\u7ec4\u91cc\u7684\u8fdb\u7a0b\u6570\u636e&#xff0c;\u53ea\u9700\u8981\u628a\u8fd9\u4e24\u4e2a\u6307\u9488\u5b58\u50a8\u7684\u5730\u5740\u4ea4\u6362\u4e00\u4e0b&#xff0c;\u5c31\u80fd\u4ece\u8c03\u5ea6running\u6570\u7ec4\u7684\u8fdb\u7a0b&#xff0c;\u5207\u6362\u5230\u8c03\u5ea6waiting\u6570\u7ec4\u7684\u8fdb\u7a0b\u4e86\u3002<\/p>\n<hr \/>\n<p><span style=\"color:#956fe7\">\u3010\u603b\u6d41\u7a0b\u68b3\u7406\u3011&#xff1a;<\/span><\/p>\n<p><span style=\"color:#fe2c24\">&lt;1&gt; \u57fa\u4e8e\u4f18\u5148\u7ea7\u7684\u65f6\u95f4\u7247\u8f6e\u8f6c\u8c03\u5ea6\u7b97\u6cd5<\/span><\/p>\n<li>\n<p><span style=\"color:#0d0016\">\u9009\u8fdb\u7a0b\u8fd0\u884c\u904d\u5386\u666e\u901a\u4f18\u5148\u7ea7\u961f\u5217queue[100~139]&#xff0c;\u53d6\u9996\u4e2a\u975e\u7a7a\u961f\u5217\u7684\u961f\u9996\u8fdb\u7a0b&#xff0c;\u901a\u8fc7\u4e0a\u4e0b\u6587\u5207\u6362\u4f7f\u5176\u8fdb\u5165\u8fd0\u884c\u6001&#xff08;R \u6001&#xff09;&#xff0c;\u5360\u7528 CPU \u6267\u884c\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u76d1\u63a7\u5207\u6362\u89e6\u53d1\u6761\u4ef6\u8fdb\u7a0b\u8fd0\u884c\u4e2d&#xff0c;\u89e6\u53d1\u4efb\u610f\u60c5\u51b5\u5219\u7acb\u5373\u6267\u884c\u8fdb\u7a0b\u5207\u6362&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u88ab\u52a8\u5207\u6362 1&#xff1a;\u5f53\u524d\u8fdb\u7a0b\u65f6\u95f4\u7247\u8017\u5c3d&#xff1b;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u88ab\u52a8\u5207\u6362 2&#xff1a;\u6709\u66f4\u9ad8\u4f18\u5148\u7ea7\u8fdb\u7a0b\u5c31\u7eea&#xff08;\u62a2\u5360 CPU&#xff09;&#xff1b;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u4e3b\u52a8\u5207\u6362&#xff1a;\u5f53\u524d\u8fdb\u7a0b\u8bf7\u6c42 I\/O\/ \u8c03\u7528sleep()&#xff08;\u4e3b\u52a8\u653e\u5f03 CPU&#xff09;\u3002<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u5207\u6362\u540e\u7684\u5373\u65f6\u5904\u7406&#xff08;\u8c03\u5ea6\u6536\u5c3e&#xff09;\u5b8c\u6210\u8fdb\u7a0b\u5207\u6362\u540e&#xff0c;\u5bf9\u539f\u8fd0\u884c\u8fdb\u7a0b\u505a\u72b6\u6001 &#043; \u961f\u5217\u5b89\u7f6e&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u65f6\u95f4\u7247\u8017\u5c3d&#xff1a;\u4fdd\u6301R \u6001&#xff0c;\u5c3e\u63d2\u5230\u539f\u4f18\u5148\u7ea7\u961f\u5217\u961f\u5c3e&#xff1b;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u88ab\u62a2\u5360&#xff1a;\u4fdd\u6301R \u6001&#xff0c;\u56de\u5230\u539f\u4f18\u5148\u7ea7\u961f\u5217\u961f\u9996&#xff1b;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u4e3b\u52a8\u653e\u5f03 CPU&#xff1a;\u8fdb\u5165\u53ef\u4e2d\u65ad\u7761\u7720\u6001&#xff08;S \u6001&#xff09;&#xff0c;\u79fb\u51fa\u8fd0\u884c\u961f\u5217&#xff08;runqueue&#xff09;&#xff0c;\u52a0\u5165\u7b49\u5f85\u961f\u5217&#xff08;wait queue&#xff09;\u3002<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u56de\u5230\u8c03\u5ea6\u8d77\u70b9\u91cd\u590d\u6b65\u9aa4 1&#xff0c;\u4ece\u8fd0\u884c\u961f\u5217\u9009\u65b0\u8fdb\u7a0b\u8fd0\u884c\u3002<\/span><\/p>\n<\/li>\n<hr \/>\n<p><span style=\"color:#fe2c24\">&lt;2&gt; \u963b\u585e\u8fdb\u7a0b\u7684\u540e\u7eed\u5904\u7406&#xff08;\u4ec5\u9488\u5bf9\u4e3b\u52a8\u653e\u5f03 CPU \u7684\u573a\u666f&#xff09;<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u5f53\u5904\u4e8e\u7b49\u5f85\u961f\u5217\u7684S \u6001\u8fdb\u7a0b\u5b8c\u6210\u7b49\u5f85\u4e8b\u4ef6&#xff08;\u5982 I\/O \u7ed3\u675f&#xff09;\u540e&#xff1a;<\/span><\/p>\n<li><span style=\"color:#0d0016\">\u4ece\u7b49\u5f85\u961f\u5217&#xff08;wait queue&#xff09;\u79fb\u51fa&#xff1b;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u5c3e\u63d2\u5230\u539f\u4f18\u5148\u7ea7\u7684\u8fd0\u884c\u961f\u5217&#xff08;runqueue&#xff09;&#xff0c;\u6062\u590d\u4e3aR \u6001&#xff0c;\u7b49\u5f85\u4e0b\u4e00\u8f6e\u8c03\u5ea6\u3002<\/span><\/li>\n<p>\u201c\u904d\u5386 queue [140]&#xff08;\u54ea\u6015\u53ea\u770b [100,139] \u533a\u95f4&#xff09;&#xff0c;\u867d\u7136\u65f6\u95f4\u590d\u6742\u5ea6\u662f\u5e38\u6570&#xff0c;\u4f46\u6bcf\u6b21\u5224\u7a7a\u90fd\u8981\u9010\u4e2a\u68c0\u67e5\u961f\u5217\u662f\u5426\u4e3a\u7a7a&#xff0c;\u5b9e\u9645\u8fd8\u662f\u4e0d\u591f\u9ad8\u6548&#xff01;<\/p>\n<p>\u56e0\u6b64\u8fd9\u65f6\u5019\u5c31\u7528\u5230\u4e86\u6211\u4eec\u5148\u524d\u8bf4\u7684\u4f4d\u56fe&#xff1a;\u7528char bits[5]&#xff08;\u5171 40 \u4e2a\u6bd4\u7279\u4f4d&#xff09;\u7684\u6bcf\u4e00\u4f4d\u5bf9\u5e94\u4e00\u4e2a\u4f18\u5148\u7ea7\u961f\u5217&#xff0c;<span style=\"color:#fe2c24\">\u4f4d\u4e3a 1 \u8868\u793a\u5bf9\u5e94\u961f\u5217\u975e\u7a7a&#xff0c;\u4f4d\u4e3a 0 \u8868\u793a\u5bf9\u5e94\u961f\u5217\u4e3a\u7a7a<\/span>\u3002\u8fd9\u6837\u4e0d\u9700\u8981\u904d\u5386\u6570\u7ec4&#xff0c;\u76f4\u63a5\u901a\u8fc7\u4f4d\u8fd0\u7b97\u5c31\u80fd\u5feb\u901f\u5b9a\u4f4d\u5230\u7b2c\u4e00\u4e2a\u975e\u7a7a\u7684\u961f\u5217&#xff0c;\u5f7b\u5e95\u89e3\u51b3\u4e86\u2018\u904d\u5386\u5224\u7a7a\u4f4e\u6548\u2019\u7684\u95ee\u9898\u3002<\/p>\n<p>\u00a0<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041951-6965c7e76da43.png\" \/>\u200b\u00a0\u00a0\u00a0<\/p>\n<p><span style=\"color:#fe2c24\">\u3010\u603b\u7ed3\u3011&#xff1a;<\/span><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8fd9\u6574\u4e2a\u6d41\u7a0b\u662f\u6807\u51c6\u7684<span style=\"color:#a2e043\"><span style=\"background-color:#d4e9d5\"> O (1) \u8c03\u5ea6\u7b97\u6cd5<\/span><\/span>&#xff1a;\u4ece<span style=\"color:#fe2c24\"><span style=\"background-color:#fbd4d0\">\u4f4d\u56fe\u5feb\u901f\u5b9a\u4f4d\u975e\u7a7a\u961f\u5217\u3001\u8c03\u5ea6\u65f6\u76f4\u63a5\u53d6\u961f\u5217\u5934\u8fdb\u7a0b\u6267\u884c&#xff0c;\u5230\u65b0\u8fdb\u7a0b\u961f\u5c3e\u63d2\u5165\u3001\u4ea4\u6362 run\/wait \u6307\u9488\u5207\u6362\u8c03\u5ea6\u6570\u7ec4<\/span><\/span>&#xff0c;\u6240\u6709\u5173\u952e\u64cd\u4f5c\u5747\u53ea\u9700\u56fa\u5b9a\u6b65\u6570\u5b8c\u6210&#xff0c;\u8017\u65f6\u4e0e\u8fdb\u7a0b \/ \u961f\u5217\u6570\u91cf\u65e0\u5173&#xff0c;\u6574\u4f53\u4e3a\u5e38\u6570\u65f6\u95f4\u590d\u6742\u5ea6\u3002<\/p>\n<hr \/>\n<h2 id=\"%E4%BA%8C%E3%80%81%E8%BF%9B%E7%A8%8B%E5%88%87%E6%8D%A2\">\u4e8c\u3001\u8fdb\u7a0b\u5207\u6362<\/h2>\n<h3 id=\"%E2%85%A0%E3%80%81%E8%BF%9B%E7%A8%8B%E5%88%87%E6%8D%A2%E6%A6%82%E5%BF%B5\">\u2160\u3001\u8fdb\u7a0b\u5207\u6362\u6982\u5ff5<\/h3>\n<p><span style=\"color:#fe2c24\">\u8fdb\u7a0b\u5207\u6362&#xff1a;<\/span>\u64cd\u4f5c\u7cfb\u7edf\u4e2d&#xff0c;CPU \u4ece\u6b63\u5728\u6267\u884c\u7684 A \u8fdb\u7a0b&#xff0c;\u6682\u505c\u5176\u8fd0\u884c\u5e76\u5207\u6362\u5230 B \u8fdb\u7a0b\u7ee7\u7eed\u6267\u884c\u7684\u6838\u5fc3\u64cd\u4f5c\u3002<\/p>\n<hr \/>\n<p>\u6838\u5fc3\u662f \u201c\u4fdd\u5b58 &#043; \u52a0\u8f7d\u201d \u4e0a\u4e0b\u6587&#xff1a;\u5148\u628a <span style=\"color:#ff9900\">A \u8fdb\u7a0b\u7684\u8fd0\u884c\u73b0\u573a<\/span>&#xff08;\u6267\u884c\u4f4d\u7f6e\u3001\u5bc4\u5b58\u5668\u6570\u636e\u3001\u5730\u5740\u6620\u5c04\u7b49&#xff09;<span style=\"color:#ff9900\">\u4fdd\u5b58<\/span>\u5230\u8fdb\u7a0b\u63a7\u5236\u5757&#xff08;PCB&#xff09;&#xff0c;\u518d\u4ece<span style=\"color:#a2e043\"> B \u8fdb\u7a0b\u7684 PCB \u4e2d\u52a0\u8f7d\u5176\u4e0a\u4e0b\u6587\u5e76\u6062\u590d<\/span>&#xff0c;\u8ba9 B \u8fdb\u7a0b\u4ece\u4e0a\u6b21\u6682\u505c\u7684\u8282\u70b9\u65e0\u7f1d\u7ee7\u7eed\u6267\u884c&#xff0c;\u6700\u7ec8\u5b9e\u73b0\u591a\u8fdb\u7a0b \u201c\u5e76\u53d1\u201d&#xff08;\u5b8f\u89c2\u540c\u65f6\u8fd0\u884c&#xff0c;\u5fae\u89c2 CPU \u8f6e\u6d41\u6267\u884c&#xff09;\u3002<\/p>\n<h3 id=\"%E2%85%A1%E3%80%81%E8%BF%9B%E7%A8%8B%E4%B8%8A%E4%B8%8B%E6%96%87%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F\">\u2161\u3001\u8fdb\u7a0b\u4e0a\u4e0b\u6587\u662f\u4ec0\u4e48&#xff1f;<\/h3>\n<p><span style=\"color:#fe2c24\">\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff1a;<\/span>\u8fdb\u7a0b\u8fd0\u884c\u7684\u5b8c\u6574 \u201c\u73b0\u573a\u5feb\u7167\u201d&#xff0c;\u662f\u8fdb\u7a0b\u80fd\u88ab\u6682\u505c\u540e\u65e0\u7f1d\u6062\u590d\u6267\u884c\u7684\u6838\u5fc3\u4f9d\u636e&#xff0c;\u5305\u542b\u8fdb\u7a0b\u7ee7\u7eed\u8fd0\u884c\u6240\u9700\u7684\u6240\u6709\u5173\u952e\u4fe1\u606f&#xff0c;\u53ef\u5206\u4e3a\u56db\u5927\u7c7b\u6838\u5fc3\u7ec4\u6210&#xff08;\u6bcf\u7c7b\u90fd\u5bf9\u5e94\u5b9e\u9645\u8fd0\u884c\u5fc5\u9700\u7684\u529f\u80fd&#xff09;<\/p>\n<hr \/>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:#c7e6ea\">1\u3001CPU \u6267\u884c\u76f8\u5173&#xff08;\u6838\u5fc3\u4e2d\u7684\u6838\u5fc3&#xff09;<\/span><\/span><\/p>\n<ul>\n<li>\u7a0b\u5e8f\u8ba1\u6570\u5668&#xff08;PC&#xff09;&#xff1a;\u8bb0\u5f55 CPU \u4e0b\u4e00\u6761\u8981\u6267\u884c\u7684\u6307\u4ee4\u5730\u5740&#xff0c;\u786e\u4fdd\u6062\u590d\u65f6\u77e5\u9053 \u201c\u4ece\u54ea\u7ee7\u7eed\u8dd1\u201d\u3002<\/li>\n<li>\u901a\u7528\u5bc4\u5b58\u5668&#xff1a;\u5b58\u50a8\u5f53\u524d\u6267\u884c\u7684\u4e2d\u95f4\u6570\u636e&#xff08;\u6bd4\u5982\u8ba1\u7b97\u7ed3\u679c\u3001\u53d8\u91cf\u503c&#xff09;&#xff0c;\u5207\u6362\u65f6\u5fc5\u987b\u5b8c\u6574\u4fdd\u5b58 \/ \u6062\u590d&#xff0c;\u5426\u5219\u6570\u636e\u4e22\u5931\u3002<\/li>\n<li>\u72b6\u6001\u5bc4\u5b58\u5668\u3001\u6808\u6307\u9488&#xff08;SP&#xff09;\u3001\u57fa\u5740\u6307\u9488&#xff08;BP&#xff09;&#xff1a;\u8bb0\u5f55 CPU \u8fd0\u884c\u72b6\u6001\u3001\u6808\u7a7a\u95f4\u5730\u5740\u8303\u56f4&#xff0c;\u4fdd\u969c\u51fd\u6570\u8c03\u7528\u3001\u6570\u636e\u5b58\u53d6\u7684\u8fde\u7eed\u6027\u3002<\/li>\n<\/ul>\n<hr \/>\n<p><span style=\"color:#ff9900\"><span style=\"background-color:#ffd7b9\">2\u3001\u5185\u5b58\u6620\u5c04\u76f8\u5173<\/span><\/span><\/p>\n<ul>\n<li>\u9875\u8868&#xff1a;\u8bb0\u5f55\u8fdb\u7a0b\u865a\u62df\u5730\u5740\u4e0e\u7269\u7406\u5185\u5b58\u5730\u5740\u7684\u6620\u5c04\u5173\u7cfb&#xff0c;\u786e\u4fdd\u6062\u590d\u540e CPU \u80fd\u7cbe\u51c6\u627e\u5230\u8fdb\u7a0b\u7684\u4ee3\u7801\u3001\u5806\u3001\u6808\u6570\u636e\u3002<\/li>\n<li>\u5730\u5740\u7a7a\u95f4\u4fe1\u606f&#xff1a;\u8fdb\u7a0b\u4e13\u5c5e\u7684\u865a\u62df\u5730\u5740\u8303\u56f4&#xff08;\u5982\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u5806\u3001\u6808\u7684\u8fb9\u754c&#xff09;&#xff0c;\u907f\u514d\u4e0e\u5176\u4ed6\u8fdb\u7a0b\u5185\u5b58\u51b2\u7a81\u3002<\/li>\n<\/ul>\n<hr \/>\n<p><span style=\"color:#a2e043\"><span style=\"background-color:#d4e9d5\">3\u3001\u8fdb\u7a0b\u8d44\u6e90\u76f8\u5173<\/span><\/span><\/p>\n<ul>\n<li>\u6253\u5f00\u7684\u6587\u4ef6\u53e5\u67c4&#xff1a;\u6bd4\u5982\u8fdb\u7a0b\u6b63\u5728\u8bfb\u5199\u7684\u6587\u4ef6\u3001\u7f51\u7edc\u5957\u63a5\u5b57&#xff0c;\u5207\u6362\u540e\u4ecd\u80fd\u6b63\u5e38\u64cd\u4f5c\u8fd9\u4e9b\u8d44\u6e90\u3002<\/li>\n<li>\u4fe1\u53f7\u63a9\u7801\u4e0e\u5904\u7406\u51fd\u6570&#xff1a;\u8bb0\u5f55\u8fdb\u7a0b\u80fd\u54cd\u5e94\u7684\u4fe1\u53f7\u3001\u4ee5\u53ca\u4fe1\u53f7\u89e6\u53d1\u540e\u7684\u5904\u7406\u903b\u8f91&#xff0c;\u907f\u514d\u4fe1\u53f7\u5904\u7406\u6df7\u4e71\u3002<\/li>\n<li>I\/O \u8bbe\u5907\u72b6\u6001&#xff1a;\u5982\u6253\u5370\u673a\u3001\u952e\u76d8\u7b49\u8bbe\u5907\u7684\u8fde\u63a5\u72b6\u6001&#xff0c;\u786e\u4fdd\u6062\u590d\u540e I\/O \u64cd\u4f5c\u80fd\u7ee7\u7eed<\/li>\n<\/ul>\n<hr \/>\n<p><span style=\"color:#956fe7\"><span style=\"background-color:#dad5e9\">4\u3001\u8fdb\u7a0b\u7ba1\u7406\u76f8\u5173<\/span><\/span><\/p>\n<ul>\n<li>\u8fdb\u7a0b\u72b6\u6001&#xff08;R\/S\/D\/T \u7b49&#xff09;&#xff1a;\u6807\u8bb0\u8fdb\u7a0b\u5f53\u524d\u662f\u5c31\u7eea\u3001\u963b\u585e\u8fd8\u662f\u8fd0\u884c\u6001\u3002<\/li>\n<li>\u4f18\u5148\u7ea7\u4e0e\u65f6\u95f4\u7247&#xff1a;\u51b3\u5b9a\u8fdb\u7a0b\u4e0b\u6b21\u88ab\u8c03\u5ea6\u7684\u987a\u5e8f\u548c\u53ef\u5360\u7528 CPU \u7684\u65f6\u957f\u3002<\/li>\n<li>\u8fdb\u7a0b\u63a7\u5236\u5757&#xff08;PCB&#xff09;\u6307\u9488&#xff1a;\u4e0a\u4e0b\u6587\u7684\u6240\u6709\u4fe1\u606f\u6700\u7ec8\u90fd\u5b58\u50a8\u5728 PCB \u4e2d&#xff0c;\u5207\u6362\u65f6\u76f4\u63a5\u64cd\u4f5c PCB \u5373\u53ef\u3002<\/li>\n<\/ul>\n<p>\u603b\u4e4b&#xff0c;\u8fdb\u7a0b\u4e0a\u4e0b\u6587\u5c31\u662f\u8fdb\u7a0b\u8fd0\u884c\u7684\u5b8c\u6574\u73b0\u573a\u5feb\u7167&#xff0c;\u6838\u5fc3\u76ee\u7684\u662f\u8ba9\u8fdb\u7a0b\u88ab\u5207\u6362\u540e\u91cd\u65b0\u8c03\u5ea6\u65f6&#xff0c;\u80fd\u65e0\u7f1d\u8854\u63a5\u4e0a\u6b21\u7684\u6267\u884c\u72b6\u6001&#xff0c;\u5c31\u50cf\u4ece\u672a\u88ab\u6253\u65ad\u8fc7\u4e00\u6837\u3002<\/p>\n<h3 id=\"%E2%85%A2%E3%80%81cpu%E4%B8%AD%E7%9A%84%E5%AF%84%E5%AD%98%E5%99%A8%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F\">\u2162\u3001cpu\u4e2d\u7684\u5bc4\u5b58\u5668\u662f\u4ec0\u4e48&#xff1f;<\/h3>\n<p>CPU \u5bc4\u5b58\u5668\u662f<span style=\"color:#ff9900\">CPU \u5185\u90e8\u7684\u9ad8\u901f\u5b58\u50a8\u5355\u5143<\/span>&#xff0c;\u7528\u4e8e\u4e34\u65f6\u5b58\u653e\u8fdb\u7a0b\u8fd0\u884c\u7684\u5173\u952e\u6570\u636e&#xff08;\u5c5e\u4e8e\u8fdb\u7a0b\u4e0a\u4e0b\u6587\u7684\u6838\u5fc3\u90e8\u5206&#xff09;&#xff0c;\u7279\u70b9\u662f\u901f\u5ea6\u8fdc\u5feb\u4e8e\u5185\u5b58&#xff0c;\u4e3b\u8981\u4f5c\u7528\u662f\u652f\u6491\u8fdb\u7a0b\u7684\u9ad8\u6548\u6267\u884c&#xff1a;<\/p>\n<hr \/>\n<p><span style=\"color:#38d8f0\">\u548c\u8fdb\u7a0b\u7684\u5173\u7cfb&#xff1a;<\/span>\u5bc4\u5b58\u5668\u91cc\u5b58\u7684\u662f<span style=\"color:#a2e043\">\u5f53\u524d\u8fdb\u7a0b\u7684\u4e34\u65f6\u6570\u636e<\/span>&#xff0c;\u5c5e\u4e8e\u8fdb\u7a0b\u4e0a\u4e0b\u6587\u7684\u4e00\u90e8\u5206 \u2014\u2014 \u8fdb\u7a0b\u5207\u6362\u65f6&#xff0c;\u8fd9\u4e9b\u6570\u636e\u4f1a\u88ab\u4fdd\u5b58\u5230 PCB&#xff0c;\u6062\u590d\u65f6\u518d\u52a0\u8f7d\u56de\u5bc4\u5b58\u5668&#xff0c;\u786e\u4fdd\u8fdb\u7a0b\u80fd\u65e0\u7f1d\u7eed\u8dd1\u3002<\/p>\n<h4 id=\"%E3%80%90%E9%97%AE%E9%A2%98%E3%80%91%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E5%87%BD%E6%95%B0%E8%BF%94%E5%9B%9E%E5%80%BC%E4%BC%9A%E8%A2%AB%E5%A4%96%E9%83%A8%E6%8B%BF%E5%88%B0%EF%BC%9F\"><span style=\"color:#fe2c24\">\u3010\u95ee\u9898\u3011&#xff1a;<\/span>\u4e3a\u4ec0\u4e48\u51fd\u6570\u8fd4\u56de\u503c\u4f1a\u88ab\u5916\u90e8\u62ff\u5230&#xff1f;<\/h4>\n<p>\u51fd\u6570\u6267\u884c\u5b8creturn a&#xff08;\u5bf9\u5e94mov eax 10&#xff09;\u540e&#xff0c;<span style=\"color:#ff9900\"><span style=\"background-color:null\">\u5916\u90e8\u4ee3\u7801\u4f1a\u628a\u5bc4\u5b58\u5668&#xff08;\u5982 EAX&#xff09;\u4e2d\u7684\u503c \u201c\u62f7\u8d1d\u201d \u5230\u81ea\u5df1\u7684\u53d8\u91cf\u4e2d<\/span><\/span>\u2014\u2014 \u6bd4\u5982\u5916\u90e8\u5199int b &#061; func()&#xff0c;\u6c47\u7f16\u5c42\u9762\u4f1a\u6267\u884cmov b, eax&#xff0c;\u628a EAX \u91cc\u7684\u8fd4\u56de\u503c\u62f7\u8d1d\u5230\u53d8\u91cfb\u7684\u5185\u5b58\u5730\u5740\u4e2d\u3002<\/p>\n<h4 id=\"%E3%80%90%E9%97%AE%E9%A2%98%E3%80%91%EF%BC%9A%E7%B3%BB%E7%BB%9F%E5%A6%82%E4%BD%95%E7%9F%A5%E9%81%93%E8%BF%9B%E7%A8%8B%E5%BD%93%E5%89%8D%E6%89%A7%E8%A1%8C%E5%88%B0%E5%93%AA%E8%A1%8C%E4%BB%A3%E7%A0%81%EF%BC%9F\"><span style=\"color:#fe2c24\">\u3010\u95ee\u9898\u3011&#xff1a;<\/span>\u7cfb\u7edf\u5982\u4f55\u77e5\u9053\u8fdb\u7a0b\u5f53\u524d\u6267\u884c\u5230\u54ea\u884c\u4ee3\u7801&#xff1f;<\/h4>\n<p>\u9760<span style=\"color:#fe2c24\"><span style=\"background-color:null\">\u7a0b\u5e8f\u8ba1\u6570\u5668&#xff08;PC\/EIP \u5bc4\u5b58\u5668&#xff09;<\/span><\/span>&#xff1a;\u8fd9\u4e2a\u5bc4\u5b58\u5668\u4e13\u95e8\u8bb0\u5f55 \u201c\u5f53\u524d\u8fdb\u7a0b\u6b63\u5728\u6267\u884c\u7684\u6307\u4ee4\u7684\u4e0b\u4e00\u884c\u6307\u4ee4\u5730\u5740\u201d&#xff1b;\u8fdb\u7a0b\u8fd0\u884c\u65f6&#xff0c;CPU \u4f1a\u6839\u636e PC\/EIP \u7684\u5730\u5740\u53d6\u6307\u4ee4\u6267\u884c&#xff1b;\u8fdb\u7a0b\u5207\u6362\u65f6&#xff0c;PC\/EIP \u7684\u503c\u4f1a\u968f\u4e0a\u4e0b\u6587\u4fdd\u5b58&#xff0c;\u6062\u590d\u65f6\u5c31\u80fd\u7cbe\u51c6\u56de\u5230\u4e0a\u6b21\u7684\u6267\u884c\u4f4d\u7f6e\u3002<\/p>\n<h3 id=\"%E2%85%A3%E3%80%81%E5%A6%82%E4%BD%95%E8%BF%9B%E8%A1%8C%E8%BF%9B%E7%A8%8B%E5%88%87%E6%8D%A2%EF%BC%9F\">\u2163\u3001\u5982\u4f55\u8fdb\u884c\u8fdb\u7a0b\u5207\u6362&#xff1f;<\/h3>\n<h4 id=\"%E3%80%90%E5%B0%8F%E6%95%85%E4%BA%8B%E3%80%91%EF%BC%9A%E5%AD%A6%E7%94%9F%E5%BD%93%E5%85%B5\">\u3010\u5c0f\u6545\u4e8b\u3011&#xff1a;\u5b66\u751f\u5f53\u5175<\/h4>\n<p>\u4f60\u662f\u4e2a\u5927\u4e8c\u9ad8\u4e2a\u7537\u751f&#xff0c;\u67d0\u5929\u5728\u98df\u5802\u95e8\u53e3\u77a5\u89c1 \u201c\u5927\u5b66\u751f\u58eb\u5175\u62db\u52df\u201d \u7684\u6d77\u62a5 \u2014\u2014 \u670d\u5f79\u4e00\u5e74\u5c31\u80fd\u8fd4\u6821\u63a5\u7740\u8bfb\u4e66&#xff0c;\u4f60\u63e3\u7740\u597d\u5947\u62a5\u4e86\u540d&#xff0c;\u5c45\u7136\u4e00\u8def\u901a\u5173\u9009\u4e0a\u4e86\u3002<\/p>\n<p>\u5174\u594b\u51b2\u660f\u4e86\u5934&#xff0c;\u4f60\u8e39\u5f00\u5bbf\u820d\u95e8\u543c&#xff1a;\u201c\u54e5\u51e0\u4e2a&#xff0c;\u6211\u53bb\u5f53\u5175\u4e86&#xff01;\u660e\u5e74\u89c1&#xff01;\u201d \u8f6c\u8eab\u5c31\u8d70 \u2014\u2014 \u53ef\u8f6c\u5ff5\u4e00\u60f3&#xff1a;\u8fd9\u4e00\u5e74\u4e0d\u4e0a\u8bfe\u3001\u4e0d\u8003\u8bd5&#xff0c;\u56de\u6765\u6015\u662f\u8981\u88ab\u9000\u5b66\u3002<\/p>\n<p>\u8d76\u7d27\u627e\u8f85\u5bfc\u5458\u6551\u547d&#xff0c;\u4ed6\u4e00\u62cd\u684c\u5b50&#xff1a;\u201c\u5f97\u5148\u529e\u2018\u4fdd\u7559\u5b66\u7c4d\u2019&#xff01;\u201d \u7b2c\u4e8c\u5929&#xff0c;\u4ed6\u585e\u7ed9\u4f60\u4e2a\u725b\u76ae\u6863\u6848\u888b&#xff0c;\u6c89\u7538\u7538\u7684&#xff1a;\u201c\u8fd9\u91cc\u9762\u662f\u4f60\u8fd9\u5b66\u671f\u7684\u6210\u7ee9\u5355\u3001\u5b66\u5230\u54ea\u7ae0\u7684\u8fdb\u5ea6\u8868&#xff0c;\u8fd8\u6709\u4f60\u7684\u5b66\u7c4d\u4fe1\u606f \u2014\u2014\u8fd9\u888b\u4e1c\u897f\u5c31\u662f\u4f60\u7684\u2018\u5168\u90e8\u5bb6\u5e95\u2019&#xff0c;\u9000\u4f0d\u56de\u6765\u5fc5\u987b\u539f\u5c01\u4e0d\u52a8\u7ed9\u6211&#xff0c;\u6211\u624d\u80fd\u628a\u4f60\u2018\u63a5\u56de\u2019\u5927\u4e8c\u3002\u201d<\/p>\n<p>\u63e3\u597d\u6863\u6848\u888b&#xff0c;\u4f60\u624d\u7b97\u8e0f\u5b9e\u5165\u4f0d\u3002<\/p>\n<p>\u4e00\u5e74\u540e\u625b\u7740\u884c\u674e\u8fd4\u6821&#xff0c;\u6ca1\u6025\u7740\u8fdb\u6559\u5ba4&#xff0c;\u5148\u6525\u7740\u6863\u6848\u888b\u627e\u8f85\u5bfc\u5458 \u2014\u2014 \u4ed6\u5bf9\u7740\u888b\u91cc\u7684\u8fdb\u5ea6\u8868\u6838\u5bf9\u534a\u5929&#xff0c;\u628a\u4f60\u585e\u8fdb\u4e86\u8fd9\u5c4a\u5927\u4e8c\u7684\u73ed\u7ea7&#xff1a;\u201c\u8ddf\u4e0a&#xff0c;\u4ece\u4f60\u53bb\u5e74\u505c\u7684\u90a3\u7ae0\u63a5\u7740\u5b66\u3002\u201d<\/p>\n<p>\u8fd9\u4e2a\u4e8b\u513f&#xff0c;\u548c\u64cd\u4f5c\u7cfb\u7edf\u91cc\u7684 \u201c\u8fdb\u7a0b\u5207\u6362\u201d \u7b80\u76f4\u662f\u4e00\u4e2a\u6a21\u5b50\u523b\u7684&#xff1a;<\/p>\n<ul>\n<li>\u4f60 &#061; \u8fdb\u7a0b&#xff1a;\u662f\u8981\u5e72\u7684 \u201c\u6d3b\u513f\u201d&#xff08;\u4f60\u5b66\u77e5\u8bc6&#xff0c;\u8fdb\u7a0b\u7b97\u6570\u636e&#xff09;&#xff1b;<\/li>\n<li>\u90a3\u4e2a\u6863\u6848\u888b &#061; \u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff1a;\u88c5\u7740\u4f60 \u201c\u63a5\u7740\u5e72\u201d \u7684\u6240\u6709\u4fe1\u606f&#xff08;\u6863\u6848\u888b\u5b58\u5b66\u4e60\u8fdb\u5ea6&#xff0c;\u4e0a\u4e0b\u6587\u5b58\u5bc4\u5b58\u5668\u3001\u6267\u884c\u4f4d\u7f6e&#xff09;&#xff1b;<\/li>\n<li>\u529e\u4fdd\u7559\u5b66\u7c4d &#061; \u4fdd\u5b58\u4e0a\u4e0b\u6587&#xff1a;\u5148\u628a \u201c\u5e72\u6d3b\u7684\u72b6\u6001\u201d \u5b58\u597d&#xff1b;<\/li>\n<li>\u53bb\u5f53\u5175 &#061; \u8fdb\u7a0b\u79bb\u5f00 CPU&#xff1a;\u6682\u65f6\u505c\u4e0b&#xff0c;\u628a\u6838\u5fc3\u8d44\u6e90\u8ba9\u51fa\u53bb&#xff1b;<\/li>\n<li>\u8fd4\u6821\u590d\u5b66 &#061; \u6062\u590d\u4e0a\u4e0b\u6587&#xff1a;\u628a\u5b58\u597d\u7684\u72b6\u6001\u8c03\u51fa\u6765&#xff0c;\u63a5\u7740\u4ece\u4e0a\u6b21\u505c\u7684\u5730\u65b9\u5e72\u3002<\/li>\n<\/ul>\n<p>\u8bf4\u767d\u4e86&#xff0c;\u8fdb\u7a0b\u5207\u6362\u4e0d\u662f \u201c\u8bf4\u505c\u5c31\u505c\u3001\u8bf4\u5f00\u5c31\u5f00\u201d\u2014\u2014 \u5f97\u5148\u628a \u201c\u5e72\u6d3b\u7684\u644a\u5b50\u201d \u6536\u597d&#xff0c;\u817e\u5730\u65b9&#xff0c;\u56de\u6765\u518d\u539f\u6837\u6446\u5f00\u63a5\u7740\u5e72&#xff0c;\u5c31\u50cf\u4f60\u63e3\u7740\u6863\u6848\u888b\u53bb\u5f53\u5175&#xff0c;\u56de\u6765\u8fd8\u80fd\u7eed\u4e0a\u5927\u4e8c\u7684\u8bfe\u3002<\/p>\n<h4 id=\"%C2%A0%E3%80%90%E8%BF%9B%E7%A8%8B%E5%88%87%E6%8D%A2%E6%A0%B8%E5%BF%83%E6%AD%A5%E9%AA%A4%E3%80%91\">\u00a0\u3010\u8fdb\u7a0b\u5207\u6362\u6838\u5fc3\u6b65\u9aa4\u3011<\/h4>\n<p><span style=\"color:#38d8f0\"><span style=\"background-color:null\">1\u3001\u4fdd\u5b58\u5f53\u524d\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff1a;<\/span><\/span><span style=\"color:#0d0016\">\u8fdb\u7a0b\u79bb\u5f00 CPU \u65f6&#xff0c;\u5c06\u5176\u5bc4\u5b58\u5668\u3001PC\u3001\u5185\u5b58\u6620\u5c04\u7b49\u4fe1\u606f\u5199\u5165\u81ea\u8eab PCB&#xff08;\u76f8\u5f53\u4e8e \u201c\u5b58\u6863\u6848\u201d&#xff09;<\/span><\/p>\n<p><span style=\"color:#ff9900\"><span style=\"background-color:null\">2\u3001\u8c03\u5ea6\u5668\u9009\u62e9\u76ee\u6807\u8fdb\u7a0b&#xff1a;<\/span><\/span><span style=\"color:#0d0016\">\u7531\u8fdb\u7a0b\u8c03\u5ea6\u5668\u4ece\u8fd0\u884c\u961f\u5217\u961f\u5217\u4e2d\u9009\u4e00\u4e2a\u5f85\u6267\u884c\u7684\u8fdb\u7a0b<\/span><\/p>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:null\">3\u3001\u6062\u590d\u76ee\u6807\u8fdb\u7a0b\u4e0a\u4e0b\u6587&#xff1a;<\/span><\/span><span style=\"color:#0d0016\">\u4ece\u76ee\u6807\u8fdb\u7a0b\u7684 PCB \u4e2d&#xff0c;\u628a\u4e4b\u524d\u4fdd\u5b58\u7684\u4fe1\u606f\u52a0\u8f7d\u56de CPU \u5bc4\u5b58\u5668\u3001\u66f4\u65b0\u5185\u5b58\u9875\u8868&#xff08;\u76f8\u5f53\u4e8e \u201c\u53d6\u6863\u6848\u6062\u590d\u72b6\u6001\u201d&#xff09;<\/span><\/p>\n<p><span style=\"color:#956fe7\"><span style=\"background-color:null\">4\u3001CPU \u6267\u884c\u76ee\u6807\u8fdb\u7a0b&#xff1a;<\/span><\/span><span style=\"color:#0d0016\">\u76ee\u6807\u8fdb\u7a0b\u4ece\u4e0a\u6b21\u6682\u505c\u7684\u4f4d\u7f6e\u7ee7\u7eed\u8fd0\u884c<\/span><\/p>\n<hr \/>\n<h2 id=\"%E4%B8%89%E3%80%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\">\u4e09\u3001\u73af\u5883\u53d8\u91cf<\/h2>\n<h3 id=\"%E2%85%A0%E3%80%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E6%A6%82%E5%BF%B5\">\u2160\u3001\u73af\u5883\u53d8\u91cf\u6982\u5ff5<\/h3>\n<p><span style=\"color:#fe2c24\"><span style=\"background-color:#fbd4d0\">\u73af\u5883\u53d8\u91cf(environment variables)<\/span><\/span><span style=\"color:#777777\">\u4e00\u822c\u662f\u6307\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7528\u6765\u6307\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u8fd0\u884c\u73af\u5883\u7684\u4e00\u4e9b\u53c2\u6570<\/span><\/p>\n<ul>\n<li>\u683c\u5f0f&#xff1a;\u53d8\u91cf\u540d &#061; \u53d8\u91cf\u503c&#xff08;\u952e\u540d\u901a\u5e38\u5927\u5199&#xff0c;\u503c\u53ef\u662f\u5b57\u7b26\u4e32\u3001\u8def\u5f84\u6216\u8def\u5f84\u5217\u8868&#xff09;\u3002<\/li>\n<li>\u4f5c\u7528&#xff1a;\u52a8\u6001\u4f20\u9012\u914d\u7f6e&#xff08;\u5982\u8def\u5f84\u3001\u8eab\u4efd\u6807\u8bc6&#xff09;&#xff0c;\u66ff\u4ee3\u786c\u7f16\u7801&#xff0c;\u9002\u914d\u4e0d\u540c\u73af\u5883\u3002<\/li>\n<li>\u7279\u70b9&#xff1a;\u5168\u5c40\u53ef\u89c1&#xff08;\u8fdb\u7a0b\u53ef\u7ee7\u627f&#xff09;\u3001\u53ef\u4e34\u65f6 \/ \u6c38\u4e45\u4fee\u6539&#xff0c;\u7cfb\u7edf\u81ea\u5e26\u6216\u7528\u6237\u81ea\u5b9a\u4e49\u5747\u53ef\u3002<\/li>\n<\/ul>\n<hr \/>\n<p>  <span style=\"color:#777777\">\u5982&#xff1a;\u6211\u4eec\u5728\u7f16\u5199<\/span><br \/>\n  <span style=\"color:#777777\">C\/C&#043;&#043;<\/span><br \/>\n  <span style=\"color:#777777\">\u4ee3\u7801\u7684\u65f6\u5019&#xff0c;\u5728\u94fe\u63a5\u7684\u65f6\u5019&#xff0c;\u4ece\u6765\u4e0d\u77e5\u9053\u6211\u4eec\u7684\u6240\u94fe\u63a5\u7684\u52a8\u6001\u9759\u6001\u5e93\u5728\u54ea\u91cc&#xff0c;\u4f46\u662f\u7167\u6837\u53ef\u4ee5\u94fe\u63a5\u6210\u529f&#xff0c;\u751f\u6210\u53ef\u6267\u884c\u7a0b\u5e8f&#xff0c;\u539f\u56e0\u5c31\u662f\u6709\u76f8\u5173\u73af\u5883\u53d8\u91cf\u5e2e\u52a9\u7f16\u8bd1\u5668\u8fdb\u884c\u67e5\u627e\u3002<\/span><\/p>\n<h4 id=\"%E9%97%AE%E9%A2%98%201%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E7%B3%BB%E7%BB%9F%E6%8C%87%E4%BB%A4%E4%B8%8D%E7%94%A8%E5%8A%A0.%2F%E5%B0%B1%E8%83%BD%E7%9B%B4%E6%8E%A5%E6%89%A7%E8%A1%8C%EF%BC%8C%E8%87%AA%E5%B7%B1%E5%86%99%E7%9A%84%E6%8C%87%E4%BB%A4%E5%8D%B4%E9%9C%80%E8%A6%81%EF%BC%9F\"><span style=\"color:#a2e043\">\u95ee\u9898 1&#xff1a;<\/span><span style=\"color:null\">\u4e3a\u4ec0\u4e48\u7cfb\u7edf\u6307\u4ee4\u4e0d\u7528\u52a0.\/\u5c31\u80fd\u76f4\u63a5\u6267\u884c&#xff0c;\u81ea\u5df1\u5199\u7684\u6307\u4ee4\u5374\u9700\u8981&#xff1f;<\/span><\/h4>\n<p>\u56e0\u4e3a\u7cfb\u7edf\u4e2d\u6709PATH\u73af\u5883\u53d8\u91cf&#xff0c;\u5b83\u5b58\u50a8\u4e86\u7cfb\u7edf\u6307\u4ee4\u7684\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84&#xff1b;\u6267\u884c\u6307\u4ee4\u65f6&#xff0c;\u7cfb\u7edf\u4f1a\u4f9d\u6b21\u5728PATH\u7684\u8def\u5f84\u4e2d\u67e5\u627e&#xff0c;\u627e\u5230\u5bf9\u5e94\u7a0b\u5e8f\u5c31\u76f4\u63a5\u6267\u884c&#xff08;\u7cfb\u7edf\u6307\u4ee4\u5728PATH\u8def\u5f84\u91cc&#xff0c;\u6240\u4ee5\u4e0d\u7528\u52a0.\/&#xff09;&#xff1b;\u800c\u81ea\u5df1\u5199\u7684\u6307\u4ee4\u4e0d\u5728PATH\u9ed8\u8ba4\u8def\u5f84\u4e2d&#xff0c;\u6240\u4ee5\u9700\u8981\u7528.\/\u6307\u5b9a\u5f53\u524d\u76ee\u5f55\u3002<\/p>\n<h4 id=\"%E9%97%AE%E9%A2%98%202%EF%BC%9A%E5%A6%82%E4%BD%95%E6%9F%A5%E7%9C%8B%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%9F\"><span style=\"color:#a2e043\">\u95ee\u9898 2&#xff1a;<\/span>\u5982\u4f55\u67e5\u770b\u73af\u5883\u53d8\u91cf&#xff1f;<\/h4>\n<p><span style=\"color:#777777\">echo $NAME<\/span><span style=\"color:#777777\"> \/\/NAME:<\/span><span style=\"color:#777777\">\u4f60\u7684\u73af\u5883\u53d8\u91cf\u540d\u79f0<\/span><\/p>\n<p><span style=\"color:#777777\">\u4f8b&#xff1a;<\/span>\u5728\u7ec8\u7aef\u6267\u884cecho $PATH&#xff0c;\u5373\u53ef\u663e\u793aPATH\u4e2d\u6240\u6709\u7684\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84&#xff08;\u591a\u4e2a\u8def\u5f84\u7528\u5192\u53f7:\u5206\u9694&#xff09;\u3002<\/p>\n<h4 id=\"%E9%97%AE%E9%A2%98%203%EF%BC%9A%E5%A6%82%E4%BD%95%E8%AE%A9%E8%87%AA%E5%B7%B1%E5%86%99%E7%9A%84%E6%8C%87%E4%BB%A4%E4%B8%8D%E7%94%A8%E5%8A%A0.%2F%E5%B0%B1%E8%83%BD%E6%89%A7%E8%A1%8C%EF%BC%9F\"><span style=\"color:#a2e043\">\u95ee\u9898 3&#xff1a;<\/span>\u5982\u4f55\u8ba9\u81ea\u5df1\u5199\u7684\u6307\u4ee4\u4e0d\u7528\u52a0.\/\u5c31\u80fd\u6267\u884c&#xff1f;<\/h4>\n<p>\u628a\u81ea\u5df1\u5199\u7684\u6307\u4ee4\u6240\u5728\u76ee\u5f55\u6dfb\u52a0\u5230PATH\u4e2d&#xff0c;<span style=\"color:#38d8f0\"><span style=\"background-color:#c7e6ea\">\u4e34\u65f6\u751f\u6548<\/span><\/span>\u7684\u547d\u4ee4\u662f<span style=\"color:#38d8f0\"><span style=\"background-color:#c7e6ea\">expor\u00a0<\/span><span style=\"background-color:#c7e6ea\">PATH&#061;$PATH:\u6307\u4ee4\u6240\u5728\u76ee\u5f55\u8def\u5f84<\/span><span style=\"background-color:#c7e6ea\">&#xff08;\u6bd4\u5982<\/span><span style=\"background-color:#c7e6ea\">PATH&#061;$PATH:\/home\/whb\/108\/lesson13<\/span><span style=\"background-color:#c7e6ea\">&#xff09;<\/span><\/span>&#xff1b;\u6dfb\u52a0\u540e&#xff0c;\u7cfb\u7edf\u4f1a\u5728\u65b0\u8def\u5f84\u4e2d\u641c\u7d22\u6307\u4ee4&#xff0c;\u6b64\u65f6\u76f4\u63a5\u8f93\u5165\u6307\u4ee4\u540d\u5373\u53ef\u6267\u884c\u3002<\/p>\n<ul>\n<li>PATH&#061;&#xff1a;\u7ed9\u00a0PATH\u00a0\u73af\u5883\u53d8\u91cf \u201c\u8d4b\u503c \/ \u91cd\u7f6e\u201d \u7684\u8bed\u6cd5\u5f00\u5934&#xff1b;<\/li>\n<li>$PATH&#xff1a;\u4ee3\u8868\u5f53\u524d\u5df2\u6709\u7684PATH\u5185\u5bb9&#xff08;\u4fdd\u7559\u539f\u6709\u7684\u6240\u6709\u641c\u7d22\u8def\u5f84&#xff0c;\u907f\u514d\u8986\u76d6&#xff09;&#xff1b;<\/li>\n<li>:&#xff1a;\u662f\u8def\u5f84\u7684\u5206\u9694\u7b26&#xff08;Linux \u4e2d\u7528\u5192\u53f7\u5206\u9694\u591a\u4e2a\u8def\u5f84&#xff09;&#xff1b;<\/li>\n<li>\u6307\u4ee4\u6240\u5728\u76ee\u5f55\u8def\u5f84&#xff1a;\u8981\u8ffd\u52a0\u7684\u65b0\u76ee\u5f55&#xff08;\u6bd4\u5982\/home\/whb\/108\/lesson13&#xff09;&#xff0c;\u5373\u8ba9\u7cfb\u7edf\u4ee5\u540e\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u641c\u7d22\u6307\u4ee4\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041951-6965c7e779813.png\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041951-6965c7e785b4c.png\" \/><\/p>\n<p>\u6b64\u65f6\u76f4\u63a5\u8f93\u5165\u00a0mytest&#xff0c;\u65e0\u9700\u52a0\u00a0.\/\u00a0\u5373\u53ef\u6267\u884c&#xff0c;\u8f93\u51fa\u7ed3\u679c\u4e3a \u201c\u6211\u662f\u4e00\u4e2a\u8fdb\u7a0b&#xff1a;PID&#xff1a;15019\u201d\u2014\u2014 \u8fd9\u8bf4\u660e\u81ea\u5b9a\u4e49\u6307\u4ee4\u5df2\u80fd\u901a\u8fc7\u00a0PATH\u00a0\u641c\u7d22\u5230\u5e76\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<h4 id=\"%E9%97%AE%E9%A2%98%204%EF%BC%9A%E4%B8%8D%E5%B0%8F%E5%BF%83%E8%A6%86%E7%9B%96%E4%BA%86%E7%B3%BB%E7%BB%9F%E6%8C%87%E4%BB%A4%E7%9A%84%E9%BB%98%E8%AE%A4%E6%90%9C%E7%B4%A2%E8%B7%AF%E5%BE%84%EF%BC%8C%E6%80%8E%E4%B9%88%E6%81%A2%E5%A4%8D%EF%BC%9F\"><span style=\"color:#a2e043\">\u95ee\u9898 4&#xff1a;<\/span>\u4e0d\u5c0f\u5fc3\u8986\u76d6\u4e86\u7cfb\u7edf\u6307\u4ee4\u7684\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84&#xff0c;\u600e\u4e48\u6062\u590d&#xff1f;<\/h4>\n<p>\u53ea\u9700\u91cd\u65b0\u767b\u5f55 Xshell \u5373\u53ef\u6062\u590d \u2014\u2014 \u56e0\u4e3a\u4e34\u65f6\u4fee\u6539\u7684PATH\u4ec5\u5728\u5f53\u524d\u7ec8\u7aef\u4f1a\u8bdd\u751f\u6548&#xff0c;\u4f1a\u8bdd\u5173\u95ed&#xff08;\u91cd\u65b0\u767b\u5f55&#xff09;\u540e\u4f1a\u81ea\u52a8\u52a0\u8f7d\u7cfb\u7edf\u9ed8\u8ba4\u7684PATH\u914d\u7f6e\u3002<\/p>\n<hr \/>\n<p>Linux \u7ec8\u7aef&#xff08;\u6bd4\u5982 Xshell&#xff09;\u542f\u52a8\u65f6&#xff0c;\u4f1a\u4ece\u7cfb\u7edf \/ \u7528\u6237\u7684\u914d\u7f6e\u6587\u4ef6&#xff08;\u5982\/etc\/profile\u3001~\/.bashrc&#xff09;\u4e2d\u8bfb\u53d6\u9ed8\u8ba4PATH\u5e76\u52a0\u8f7d\u5230\u5f53\u524d\u4f1a\u8bdd\u7684\u5185\u5b58\u91cc\u3002<\/p>\n<p>\u5f53\u4f60\u5728\u7ec8\u7aef\u91cc\u4e34\u65f6\u4fee\u6539PATH&#xff08;\u6bd4\u5982\u6267\u884cPATH&#061;\/\u9519\u8bef\u8def\u5f84&#xff09;&#xff0c;\u8fd9\u4e2a\u4fee\u6539\u53ea\u5728\u5f53\u524d\u4f1a\u8bdd\u7684\u5185\u5b58\u4e2d\u751f\u6548&#xff0c;\u5e76\u6ca1\u6709\u5199\u5165\u4efb\u4f55\u914d\u7f6e\u6587\u4ef6\u3002\u4e00\u65e6\u5173\u95ed\u7ec8\u7aef&#xff08;\u6216\u91cd\u65b0\u767b\u5f55&#xff09;&#xff0c;\u5f53\u524d\u4f1a\u8bdd\u7684\u5185\u5b58\u6570\u636e\u4f1a\u88ab\u6e05\u7a7a&#xff1b;\u65b0\u4f1a\u8bdd\u542f\u52a8\u65f6&#xff0c;\u4f1a\u91cd\u65b0\u4ece\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u9ed8\u8ba4PATH&#xff0c;\u81ea\u7136\u5c31\u6062\u590d\u6210\u7cfb\u7edf\u539f\u59cb\u914d\u7f6e\u4e86\u3002<\/p>\n<p>\u7b80\u5355\u8bf4&#xff1a;\u4e34\u65f6\u4fee\u6539\u662f \u201c\u5185\u5b58\u7ea7\u7684\u4e34\u65f6\u53d8\u91cf\u201d&#xff0c;\u6ca1\u52a8\u5230\u5b58\u50a8\u914d\u7f6e\u7684\u6587\u4ef6&#xff0c;\u6240\u4ee5\u91cd\u542f\u4f1a\u8bdd\u5c31\u80fd\u6062\u590d&#xff5e;<\/p>\n<h4 id=\"%E9%97%AE%E9%A2%98%205%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E7%99%BB%E5%BD%95%E7%B3%BB%E7%BB%9F%E5%90%8E%E4%BC%9A%E7%9B%B4%E6%8E%A5%E8%BF%9B%E5%85%A5%E5%AE%B6%E7%9B%AE%E5%BD%95%EF%BC%9F\"><span style=\"color:#a2e043\">\u95ee\u9898 5&#xff1a;<\/span>\u4e3a\u4ec0\u4e48\u767b\u5f55\u7cfb\u7edf\u540e\u4f1a\u76f4\u63a5\u8fdb\u5165\u5bb6\u76ee\u5f55&#xff1f;<\/h4>\n<p>\u56e0\u4e3a$HOME\u73af\u5883\u53d8\u91cf\u8bb0\u5f55\u4e86\u5f53\u524d\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u8def\u5f84&#xff1b;\u7cfb\u7edf\u767b\u5f55\u6d41\u7a0b\u4f1a\u81ea\u52a8\u8bfb\u53d6$HOME\u7684\u503c&#xff0c;\u7136\u540e\u5207\u6362\u5230\u5bf9\u5e94\u7684\u76ee\u5f55&#xff08;\u6bd4\u5982 root \u7528\u6237\u7684$HOME\u662f\/root&#xff0c;\u666e\u901a\u7528\u6237\u7684$HOME\u662f\/home\/\u7528\u6237\u540d&#xff09;\u3002<\/p>\n<h4 id=\"%E9%97%AE%E9%A2%98%206%EF%BC%9Aecho%20%24SHELL%E8%BE%93%E5%87%BA%2Fbin%2Fbash%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%EF%BC%9F\"><span style=\"color:#a2e043\">\u95ee\u9898 6&#xff1a;<\/span>echo $SHELL\u8f93\u51fa\/bin\/bash\u662f\u4ec0\u4e48\u610f\u601d&#xff1f;<\/h4>\n<p>$SHELL\u662f\u8bb0\u5f55\u5f53\u524d\u7528\u6237\u9ed8\u8ba4 Shell \u7a0b\u5e8f\u7684\u73af\u5883\u53d8\u91cf&#xff0c;\/bin\/bash\u662f\u8be5 Shell&#xff08;bash&#xff09;\u5728\u7cfb\u7edf\u4e2d\u7684\u5b9e\u9645\u5b58\u50a8\u8def\u5f84 \u2014\u2014 \u5373\u5f53\u524d\u7528\u6237\u767b\u5f55\u540e\u9ed8\u8ba4\u7528 bash \u8fdb\u884c\u547d\u4ee4\u4ea4\u4e92\u3002<\/p>\n<h4 id=\"%E9%97%AE%E9%A2%98%207%EF%BC%9A%24SHELL%E7%9A%84%E6%A0%B8%E5%BF%83%E4%BD%9C%E7%94%A8%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F\"><span style=\"color:#a2e043\">\u95ee\u9898 7&#xff1a;<\/span>$SHELL\u7684\u6838\u5fc3\u4f5c\u7528\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p>\u6838\u5fc3\u4f5c\u7528\u662f\u544a\u8bc9\u7cfb\u7edf \u201c\u5f53\u524d\u7528\u6237\u767b\u5f55\u540e\u9ed8\u8ba4\u4f7f\u7528\u54ea\u4e2a Shell \u7a0b\u5e8f\u8fdb\u884c\u547d\u4ee4\u4ea4\u4e92\u201d&#xff0c;\u5176\u8f93\u51fa\u7684\u8def\u5f84\u5bf9\u5e94\u8be5 Shell \u7a0b\u5e8f\u5728\u7cfb\u7edf\u4e2d\u7684\u5b58\u653e\u4f4d\u7f6e&#xff08;\u6bd4\u5982\u9ed8\u8ba4 Shell \u662f zsh \u65f6&#xff0c;echo $SHELL\u4f1a\u663e\u793a\/bin\/zsh&#xff09;\u3002<\/p>\n<h4 id=\"env%E5%91%BD%E4%BB%A4\">env\u547d\u4ee4<\/h4>\n<p><span style=\"color:#38d8f0\">\u4f5c\u7528&#xff1a;<\/span>\u7528\u4e8e\u67e5\u770b\u5f53\u524d\u7ec8\u7aef\u7684\u6240\u6709\u73af\u5883\u53d8\u91cf<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041951-6965c7e79f0c8.png\" \/><\/p>\n<h4 id=\"%E3%80%90%E6%A0%B8%E5%BF%83%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%A1%A8%E6%A0%BC%E3%80%91\">\u3010\u6838\u5fc3\u73af\u5883\u53d8\u91cf\u8868\u683c\u3011<\/h4>\n<table>\n<tr>\u73af\u5883\u53d8\u91cf\u540d\u6838\u5fc3\u4f5c\u7528\u793a\u4f8b\u503c\u5b9e\u7528\u573a\u666f<\/tr>\n<tr>\n<td>PATH<\/td>\n<td>\u7cfb\u7edf\u641c\u7d22\u53ef\u6267\u884c\u547d\u4ee4\u7684\u8def\u5f84\u5217\u8868&#xff0c;\u51b3\u5b9a\u8f93\u5165\u547d\u4ee4\u65f6\u7cfb\u7edf\u53bb\u54ea\u91cc\u627e\u7a0b\u5e8f<\/td>\n<td>\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin<\/td>\n<td>1. \u4e0d\u7528\u52a0.\/ \u76f4\u63a5\u6267\u884c\u81ea\u5b9a\u4e49\u7a0b\u5e8f&#xff08;\u9700\u628a\u7a0b\u5e8f\u8def\u5f84\u52a0\u5165 PATH&#xff09;&#xff1b;2. \u7cfb\u7edf\u6307\u4ee4&#xff08;\u5982 ls\/cd&#xff09;\u80fd\u76f4\u63a5\u6267\u884c\u7684\u6838\u5fc3\u539f\u56e0<\/td>\n<\/tr>\n<tr>\n<td>HOME<\/td>\n<td>\u5f53\u524d\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u8def\u5f84&#xff0c;\u767b\u5f55\u540e\u9ed8\u8ba4\u8fdb\u5165\u7684\u76ee\u5f55<\/td>\n<td>\/home\/ljh&#xff08;\u666e\u901a\u7528\u6237&#xff09;\u3001\/root&#xff08;root \u7528\u6237&#xff09;<\/td>\n<td>1. cd ~\/cd $HOME \u4e00\u952e\u56de\u5230\u5bb6\u76ee\u5f55&#xff1b;2. \u5b58\u50a8\u7528\u6237\u4e2a\u4eba\u914d\u7f6e\u6587\u4ef6&#xff08;\u5982.bashrc&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>SHELL<\/td>\n<td>\u5f53\u524d\u7528\u6237\u9ed8\u8ba4\u4f7f\u7528\u7684 Shell \u89e3\u91ca\u5668\u8def\u5f84<\/td>\n<td>\/bin\/bash&#xff08;\u6700\u5e38\u7528&#xff09;\u3001\/bin\/zsh<\/td>\n<td>\u51b3\u5b9a\u7ec8\u7aef\u7684\u547d\u4ee4\u4ea4\u4e92\u89c4\u5219&#xff08;\u5982\u8bed\u6cd5\u3001\u5feb\u6377\u952e&#xff09;&#xff0c;\u65b0\u624b\u4e3b\u8981\u7528 bash<\/td>\n<\/tr>\n<tr>\n<td>USER<\/td>\n<td>\u5f53\u524d\u767b\u5f55\u7684\u7528\u6237\u540d<\/td>\n<td>ljh\u3001root<\/td>\n<td>\u533a\u5206\u5f53\u524d\u64cd\u4f5c\u7684\u7528\u6237\u8eab\u4efd&#xff0c;\u6743\u9650\u76f8\u5173\u64cd\u4f5c&#xff08;\u5982 sudo&#xff09;\u4f1a\u7528\u5230<\/td>\n<\/tr>\n<tr>\n<td>PWD<\/td>\n<td>\u5f53\u524d\u6240\u5728\u7684\u5de5\u4f5c\u76ee\u5f55\u8def\u5f84<\/td>\n<td>\/home\/ljh\/code-under-linux\/Test-course<\/td>\n<td>\u7b49\u540c\u4e8e pwd \u547d\u4ee4\u7684\u8f93\u51fa&#xff0c;\u811a\u672c\u4e2d\u53ef\u52a8\u6001\u83b7\u53d6\u5f53\u524d\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td>LANG<\/td>\n<td>\u7cfb\u7edf\u8bed\u8a00 \/ \u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e<\/td>\n<td>en_US.utf8\u3001zh_CN.utf8<\/td>\n<td>\u51b3\u5b9a\u7ec8\u7aef \/ \u7a0b\u5e8f\u7684\u5b57\u7b26\u663e\u793a\u683c\u5f0f&#xff08;\u907f\u514d\u4e2d\u6587\u4e71\u7801&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>TERM<\/td>\n<td>\u7ec8\u7aef\u7c7b\u578b&#xff0c;\u9002\u914d\u7ec8\u7aef\u7684\u663e\u793a \/ \u4ea4\u4e92\u89c4\u5219<\/td>\n<td>xterm-256color<\/td>\n<td>\u786e\u4fdd\u7ec8\u7aef\u80fd\u6b63\u5e38\u663e\u793a\u989c\u8272\u3001\u5149\u6807\u3001\u5feb\u6377\u952e\u7b49&#xff08;Xshell\/SSH \u767b\u5f55\u65f6\u81ea\u52a8\u9002\u914d&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>LOGNAME<\/td>\n<td>\u5f53\u524d\u767b\u5f55\u7528\u6237\u7684\u540d\u79f0&#xff08;\u548c USER \u57fa\u672c\u4e00\u81f4&#xff09;<\/td>\n<td>ljh<\/td>\n<td>\u811a\u672c\u4e2d\u5224\u65ad\u5f53\u524d\u64cd\u4f5c\u7528\u6237\u8eab\u4efd<\/td>\n<\/tr>\n<tr>\n<td>OLDPWD<\/td>\n<td>\u4e0a\u4e00\u6b21\u6240\u5728\u7684\u5de5\u4f5c\u76ee\u5f55\u8def\u5f84<\/td>\n<td>\/home\/ljh<\/td>\n<td>\u6267\u884c cd &#8211; \u53ef\u4e00\u952e\u56de\u5230\u4e0a\u4e00\u6b21\u7684\u76ee\u5f55&#xff0c;\u65b0\u624b\u5feb\u901f\u5207\u6362\u76ee\u5f55\u5e38\u7528<\/td>\n<\/tr>\n<tr>\n<td>PS1<\/td>\n<td>\u7ec8\u7aef\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u7684\u683c\u5f0f&#xff08;\u51b3\u5b9a [ljh&#064;localhost\u00a0~]$ \u8fd9\u7c7b\u663e\u793a&#xff09;<\/td>\n<td>[\\\\u&#064;\\\\h \\\\W]$<\/td>\n<td>\u81ea\u5b9a\u4e49\u63d0\u793a\u7b26\u6837\u5f0f&#xff08;\u5982\u663e\u793a\u5f53\u524d\u8def\u5f84\u3001\u7528\u6237\u540d&#xff09;&#xff0c;\u65b0\u624b\u4e86\u89e3\u65e0\u9700\u4fee\u6539<\/td>\n<\/tr>\n<tr>\n<td>HISTSIZE<\/td>\n<td>\u63a7\u5236\u7ec8\u7aef\u4fdd\u5b58\u7684\u5386\u53f2\u547d\u4ee4\u6570\u91cf&#xff0c;\u662f \u201c\u6309\u4e0a\u4e0b\u952e\u8c03\u53d6\u5386\u53f2\u6307\u4ee4\u201d \u7684\u529f\u80fd\u6e90\u5934<\/td>\n<td>3000<\/td>\n<td>1. \u6309\u2191\/\u2193\u952e\u5feb\u901f\u8c03\u53d6\u4e4b\u524d\u6267\u884c\u8fc7\u7684\u547d\u4ee4&#xff1b;2. \u8c03\u6574\u6570\u503c\u53ef\u589e\u52a0 \/ \u51cf\u5c11\u5386\u53f2\u547d\u4ee4\u7684\u5b58\u50a8\u6761\u6570<\/td>\n<\/tr>\n<\/table>\n<h4 id=\"%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%A6%82%E4%BD%95%E8%A2%AB%E7%BB%84%E7%BB%87%EF%BC%9F\">\u73af\u5883\u53d8\u91cf\u5982\u4f55\u88ab\u7ec4\u7ec7&#xff1f;<\/h4>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041952-6965c7e806c3f.png\" \/><\/p>\n<p> <span style=\"color:#333333\">\u6bcf\u4e2a\u7a0b\u5e8f\u90fd\u4f1a\u6536\u5230\u4e00\u5f20\u73af\u5883\u8868&#xff0c;\u73af\u5883\u8868\u662f\u4e00\u4e2a\u5b57\u7b26\u6307\u9488\u6570\u7ec4&#xff0c;\u6bcf\u4e2a\u6307\u9488\u6307\u5411\u4e00\u4e2a\u4ee5<\/span><br \/>\n <span style=\"color:#333333\">\u2019\\\\0\u2019<\/span><br \/>\n <span style=\"color:#333333\">\u7ed3\u5c3e\u7684\u73af\u5883\u5b57\u7b26\u4e32\u00a0<\/span><\/p>\n<hr \/>\n<h3 id=\"%E2%85%A1%E3%80%81%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8F%82%E6%95%B0\">\u2161\u3001\u547d\u4ee4\u884c\u53c2\u6570<\/h3>\n<p>\u6211\u4eec\u7f16\u5199\u4ee3\u7801\u65f6\u5199\u7684 main \u51fd\u6570\u5b9e\u9645\u662f\u6709\u53c2\u6570\u7684&#xff0c;\u53ea\u4e0d\u8fc7\u6211\u4eec\u5148\u524d\u7528\u4e0d\u5230\u7f62\u4e86 \u2014\u2014 \u800c\u8fd9\u4e9b\u53c2\u6570&#xff0c;\u5bf9\u5e94\u7684\u5c31\u662f\u547d\u4ee4\u884c\u53c2\u6570&#xff1a;\u6bd4\u5982\u5728\u7ec8\u7aef\u6267\u884c.\/mytest arg1 arg2\u65f6&#xff0c;\u7a0b\u5e8f\u540d.\/mytest\u540e\u9762\u8ddf\u7740\u7684arg1\u3001arg2&#xff0c;\u5c31\u662f\u547d\u4ee4\u884c\u53c2\u6570\u3002\u8fd9\u4e9b\u5185\u5bb9\u4f1a\u88ab\u4f20\u9012\u7ed9 main \u51fd\u6570\u7684\u53c2\u6570&#xff0c;\u8ba9\u7a0b\u5e8f\u80fd\u6839\u636e\u8f93\u5165\u7684\u4e0d\u540c\u53c2\u6570&#xff0c;\u6267\u884c\u5bf9\u5e94\u7684\u903b\u8f91\u3002<\/p>\n<p>\u5e38\u7528\u7684main\u51fd\u6570\u53c2\u6570&#xff1a;\u00a0<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041952-6965c7e82b85e.png\" \/><\/p>\n<p><span style=\"color:#38d8f0\">\u00a0int argc<\/span><\/p>\n<ul>\n<li>\u5168\u79f0&#xff1a;argument count&#xff08;\u53c2\u6570\u4e2a\u6570&#xff09;<\/li>\n<li>\u4f5c\u7528&#xff1a;\u8bb0\u5f55\u7ec8\u7aef\u6267\u884c\u7a0b\u5e8f\u65f6&#xff0c;\u4f20\u5165\u7684 \u201c\u547d\u4ee4\u884c\u53c2\u6570\u7684\u603b\u6570\u91cf\u201d\u3002\n<ul>\n<li>\u6ce8\u610f&#xff1a;\u7a0b\u5e8f\u540d\u672c\u8eab\u4f1a\u88ab\u7b97\u4f5c\u7b2c 1 \u4e2a\u53c2\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<p><span style=\"color:#38d8f0\">char* argv[]<\/span><\/p>\n<ul>\n<li>\u5168\u79f0&#xff1a;argument vector&#xff08;\u53c2\u6570\u5411\u91cf \/ \u6570\u7ec4&#xff09;<\/li>\n<li>\u4f5c\u7528&#xff1a;\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\u6570\u7ec4&#xff0c;\u5b58\u50a8\u4e86\u7ec8\u7aef\u4f20\u5165\u7684\u6bcf\u4e00\u4e2a\u547d\u4ee4\u884c\u53c2\u6570\u3002\n<ul>\n<li>argv[0]&#xff1a;\u9ed8\u8ba4\u662f\u7a0b\u5e8f\u672c\u8eab\u7684\u8def\u5f84 \/ \u540d\u79f0&#xff1b;<\/li>\n<li>argv[1]&#xff1a;\u7b2c 1 \u4e2a\u7528\u6237\u4f20\u5165\u7684\u53c2\u6570&#xff1b;<\/li>\n<li>argv[2]&#xff1a;\u7b2c 2 \u4e2a\u7528\u6237\u4f20\u5165\u7684\u53c2\u6570&#xff1b;<\/li>\n<li>\u2026\u2026 \u4ee5\u6b64\u7c7b\u63a8&#xff0c;\u6700\u591a\u6709argc\u4e2a\u5143\u7d20\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041952-6965c7e846b83.png\" \/>\u00a0\u00a0<\/p>\n<p>\u5728 C \u8bed\u8a00\u7684char* argv[]\u6570\u7ec4\u4e2d&#xff08;\u8be5\u6570\u7ec4\u4e5f\u88ab\u79f0\u4e3a <span style=\"color:#38d8f0\">\u201c\u547d\u4ee4\u884c\u53c2\u6570\u8868\u201d<\/span>&#xff09;&#xff0c;\u65e0\u8bba\u53c2\u6570\u6570\u91cf\u662f\u591a\u5c11&#xff0c;argv\u7684\u6700\u540e\u4e00\u4e2a\u6709\u6548\u5143\u7d20\u7684\u4e0b\u4e00\u4e2a\u4f4d\u7f6e&#xff08;\u5373argv[argc]&#xff09;\u4f1a\u88ab\u7cfb\u7edf\u81ea\u52a8\u521d\u59cb\u5316\u4e3a NULL\u3002<\/p>\n<p>\u5728\u6267\u884c\u547d\u4ee4.\/test a b c\u65f6&#xff0c;\u8fd9\u4e9b\u53c2\u6570\u4f1a\u6309\u987a\u5e8f\u5b58\u5165char* argv[]\u8fd9\u4e2a\u5b57\u7b26\u6307\u9488\u6570\u7ec4&#xff0c;\u5177\u4f53\u5bf9\u5e94\u5173\u7cfb\u662f&#xff1a;<\/p>\n<ul>\n<li>argv[0]\u00a0\u5b58\u50a8\u7b2c\u4e00\u4e2a\u53c2\u6570&#xff1a;&#034;.\/test&#034;&#xff08;\u7a0b\u5e8f\u672c\u8eab\u7684\u8def\u5f84 \/ \u540d\u79f0&#xff09;<\/li>\n<li>argv[1]\u00a0\u5b58\u50a8\u7b2c\u4e8c\u4e2a\u53c2\u6570&#xff1a;&#034;a&#034;<\/li>\n<li>argv[2]\u00a0\u5b58\u50a8\u7b2c\u4e09\u4e2a\u53c2\u6570&#xff1a;&#034;b&#034;<\/li>\n<li>argv[3]\u00a0\u5b58\u50a8\u7b2c\u56db\u4e2a\u53c2\u6570&#xff1a;&#034;c&#034;<\/li>\n<\/ul>\n<p>&#xff08;\u8865\u5145\u8bf4\u660e&#xff1a;\u7ec8\u7aef\u4e2d\u53c2\u6570\u4e4b\u95f4\u7684\u7a7a\u683c\u662f\u5206\u9694\u7b26&#xff0c;\u6240\u4ee5.\/test a b c\u4f1a\u88ab\u62c6\u5206\u6210 4 \u4e2a\u72ec\u7acb\u7684\u5b57\u7b26\u4e32&#xff0c;\u4f9d\u6b21\u586b\u5165argv\u6570\u7ec4\u7684\u5bf9\u5e94\u4f4d\u7f6e&#xff09;<\/p>\n<p>\u65e2\u7136 main \u51fd\u6570\u53ef\u4ee5\u63a5\u6536 argc \u548c argv \u53c2\u6570&#xff0c;\u8fd9\u5c31\u76f4\u63a5\u8bc1\u660e main \u51fd\u6570\u5e76\u975e\u7a0b\u5e8f\u8fd0\u884c\u7684 \u201c\u539f\u751f\u8d77\u70b9\u201d\u2014\u2014 \u7a0b\u5e8f\u542f\u52a8\u65f6&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u5148\u8c03\u7528\u542f\u52a8\u51fd\u6570&#xff08;\u5982Startup()\u6216CRTStartup()&#xff0c;\u4e0d\u540c\u7f16\u8bd1\u73af\u5883\u547d\u540d\u7565\u6709\u5dee\u5f02&#xff09;&#xff0c;\u7531\u8fd9\u4e9b\u542f\u52a8\u51fd\u6570\u5b8c\u6210\u7a0b\u5e8f\u8fd0\u884c\u524d\u7684\u57fa\u7840\u521d\u59cb\u5316&#xff08;\u6bd4\u5982\u5185\u5b58\u5206\u914d\u3001\u8fd0\u884c\u73af\u5883\u914d\u7f6e&#xff09;&#xff0c;\u6700\u7ec8\u518d\u7531\u542f\u52a8\u51fd\u6570\u4e3b\u52a8\u8c03\u7528 main \u51fd\u6570&#xff0c;\u5e76\u5c06\u547d\u4ee4\u884c\u53c2\u6570\u5c01\u88c5\u4e3a argc \u548c argv \u4f20\u9012\u7ed9\u5b83\u3002<\/p>\n<p>\u7b80\u8a00\u4e4b&#xff1a;\u64cd\u4f5c\u7cfb\u7edf \u2192 Startup\/CRTStartup&#xff08;\u542f\u52a8\u51fd\u6570&#xff09; \u2192 main\u51fd\u6570&#xff08;\u63a5\u6536\u53c2\u6570\u6267\u884c&#xff09;&#xff0c;main \u51fd\u6570\u7684\u53c2\u6570\u6b63\u662f\u8fd9\u4e00\u8c03\u7528\u94fe\u7684\u76f4\u63a5\u4f53\u73b0\u3002<\/p>\n<hr \/>\n<h4 id=\"Q%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E8%AE%A9%20main%20%E5%87%BD%E6%95%B0%E6%94%AF%E6%8C%81%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8F%82%E6%95%B0%EF%BC%88argc%2Fargv%EF%BC%89%EF%BC%9F\">Q&#xff1a;\u4e3a\u4ec0\u4e48\u8981\u8ba9 main \u51fd\u6570\u652f\u6301\u547d\u4ee4\u884c\u53c2\u6570&#xff08;argc\/argv&#xff09;&#xff1f;<\/h4>\n<p>\u6838\u5fc3\u662f\u4e3a\u6307\u4ee4\u3001\u5de5\u5177\u3001\u8f6f\u4ef6\u7b49\u63d0\u4f9b\u547d\u4ee4\u884c\u9009\u9879\u7684\u652f\u6301\u2014\u2014 \u901a\u8fc7\u5728\u6267\u884c\u7a0b\u5e8f\u65f6\u4f20\u5165\u4e0d\u540c\u53c2\u6570&#xff0c;\u80fd\u8ba9\u540c\u4e00\u4e2a\u7a0b\u5e8f\u5b9e\u73b0\u4e0d\u540c\u529f\u80fd\u3002\u6bd4\u5982ls -l&#xff08;ls\u662f\u7a0b\u5e8f&#xff0c;-l\u662f\u547d\u4ee4\u884c\u53c2\u6570&#xff09;&#xff0c;\u4f20\u5165-l\u5c31\u80fd\u8ba9ls\u4ee5\u8be6\u7ec6\u5217\u8868\u5f62\u5f0f\u663e\u793a\u6587\u4ef6&#xff0c;\u4e0d\u4f20\u5219\u662f\u9ed8\u8ba4\u683c\u5f0f&#xff0c;\u7075\u6d3b\u9002\u914d\u4e0d\u540c\u4f7f\u7528\u573a\u666f\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041952-6965c7e8b0b47.png\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041952-6965c7e8db05a.png\" \/><\/p>\n<p>\u5982\u679c\u60f3\u5b9e\u73b0\u591a\u9009\u9879&#xff0c;\u53ef\u4ee5\u7528\u5faa\u73af\u904d\u5386\u6240\u6709\u53c2\u6570 &#043; \u9010\u4e2a\u5339\u914d\u5224\u65ad&#xff0c;\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;string.h&gt;<\/p>\n<p>int main(int argc, char* argv[])<br \/>\n{<br \/>\n    \/\/ 1. \u65e0\u53c2\u6570\u65f6\u6253\u5370\u7528\u6cd5\u63d0\u793a&#xff08;argc&#061;1 \u8868\u793a\u53ea\u6709\u7a0b\u5e8f\u540d&#xff09;<br \/>\n    if (argc &#061;&#061; 1)<br \/>\n    {<br \/>\n        printf(&#034;Usage: %s -[a|b|c|d] [\u591a\u4e2a\u53c2\u6570\u53ef\u53e0\u52a0]\\\\n&#034;, argv[0]);<br \/>\n        printf(&#034;\u793a\u4f8b: %s -a -b -c\\\\n&#034;, argv[0]);<br \/>\n        return 1; \/\/ \u9000\u51fa\u7a0b\u5e8f&#xff0c;\u907f\u514d\u540e\u7eed\u903b\u8f91\u6267\u884c<br \/>\n    }<\/p>\n<p>    \/\/ 2. \u904d\u5386\u6240\u6709\u4f20\u5165\u7684\u53c2\u6570&#xff08;i\u4ece1\u5f00\u59cb&#xff0c;\u8df3\u8fc7argv[0]\u7a0b\u5e8f\u540d&#xff09;<br \/>\n    for (int i &#061; 1; i &lt; argc; i&#043;&#043;)<br \/>\n    {<br \/>\n        \/\/ \u9010\u4e2a\u5224\u65ad\u53c2\u6570&#xff0c;\u5339\u914d\u5219\u6267\u884c\u5bf9\u5e94\u529f\u80fd<br \/>\n        if (strcmp(argv[i], &#034;-a&#034;) &#061;&#061; 0)<br \/>\n        {<br \/>\n            printf(&#034;\u6267\u884c\u529f\u80fd1&#xff08;\u53c2\u6570-a&#xff09;\\\\n&#034;);<br \/>\n        }<br \/>\n        else if (strcmp(argv[i], &#034;-b&#034;) &#061;&#061; 0)<br \/>\n        {<br \/>\n            printf(&#034;\u6267\u884c\u529f\u80fd2&#xff08;\u53c2\u6570-b&#xff09;\\\\n&#034;);<br \/>\n        }<br \/>\n        else if (strcmp(argv[i], &#034;-c&#034;) &#061;&#061; 0)<br \/>\n        {<br \/>\n            printf(&#034;\u6267\u884c\u529f\u80fd3&#xff08;\u53c2\u6570-c&#xff09;\\\\n&#034;);<br \/>\n        }<br \/>\n        else if (strcmp(argv[i], &#034;-d&#034;) &#061;&#061; 0)<br \/>\n        {<br \/>\n            printf(&#034;\u6267\u884c\u529f\u80fd4&#xff08;\u53c2\u6570-d&#xff09;\\\\n&#034;);<br \/>\n        }<br \/>\n        else<br \/>\n        {<br \/>\n            \/\/ 3. \u8bc6\u522b\u5230\u975e\u6cd5\u53c2\u6570\u65f6\u63d0\u793a&#xff0c;\u5e76\u7ee7\u7eed\u5904\u7406\u5176\u4ed6\u53c2\u6570<br \/>\n            printf(&#034;\u8b66\u544a&#xff1a;\u65e0\u6548\u53c2\u6570 %s&#xff0c;\u4ec5\u652f\u6301 -a\/-b\/-c\/-d\\\\n&#034;, argv[i]);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    return 0;<br \/>\n} <\/p>\n<h4 id=\"C%EF%BC%9A%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%8F%82%E6%95%B0\">C&#xff1a;\u73af\u5883\u53d8\u91cf\u53c2\u6570<\/h4>\n<p>\u5b9e\u9645\u4e0a&#xff0c;\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7main\u51fd\u6570\u7684\u73af\u5883\u53d8\u91cf\u53c2\u6570&#xff08;\u5982char *envp[]&#xff09;&#xff0c;\u83b7\u53d6\u5f53\u524d\u7a0b\u5e8f\u6240\u5728 bash \u8fdb\u7a0b\u7684\u6240\u6709\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041953-6965c7e9015cb.png\" \/><\/p>\n<p>envp\u548cargv\u662f\u540c\u7c7b\u578b\u7684\u5b57\u7b26\u6307\u9488\u6570\u7ec4&#xff08;\u90fd\u5c5e\u4e8e \u201c\u53c2\u6570\u5411\u91cf\u8868\u201d&#xff09;&#xff0c;envp\u5bf9\u5e94\u7684\u662f\u73af\u5883\u53d8\u91cf\u8868&#xff1b;\u7531\u4e8e\u73af\u5883\u53d8\u91cf\u7684\u6570\u91cf\u4e0d\u56fa\u5b9a&#xff0c;\u6240\u4ee5\u9700\u8981\u901a\u8fc7envp\u672b\u5c3e\u7684NULL\u6307\u9488\u6765\u5224\u65ad\u904d\u5386\u7684\u7ed3\u675f\u3002<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041953-6965c7e90d399.png\" \/><\/p>\n<h3 id=\"%E2%85%A2%E3%80%81%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%92%8C%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%9F\">\u2162\u3001\u5982\u4f55\u83b7\u53d6\u548c\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf&#xff1f;<\/h3>\n<h4 id=\"G%EF%BC%9A%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%9F\">G&#xff1a;\u5982\u4f55\u83b7\u53d6\u73af\u5883\u53d8\u91cf&#xff1f;<\/h4>\n<p>\u524d\u9762\u5df2\u7ecf\u8bb2\u4e86 3 \u79cd\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u7684\u65b9\u5f0f&#xff1a;<\/p>\n<li>\u7ec8\u7aef\u4e2d\u901a\u8fc7echo\u547d\u4ee4&#xff08;\u5982echo $PATH&#xff09;&#xff0c;\u76f4\u63a5\u6253\u5370\u5355\u4e2a\u73af\u5883\u53d8\u91cf\u7684\u503c&#xff1b;<\/li>\n<li>\u7ec8\u7aef\u4e2d\u901a\u8fc7env\u547d\u4ee4&#xff0c;\u67e5\u770b\u6240\u6709\u73af\u5883\u53d8\u91cf\u7684\u5217\u8868&#xff1b;<\/li>\n<li>C \u7a0b\u5e8f\u4e2d\u901a\u8fc7main\u51fd\u6570\u7684\u73af\u5883\u53d8\u91cf\u53c2\u6570&#xff08;\u5982char *envp[]&#xff09;&#xff0c;\u5728\u4ee3\u7801\u4e2d\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<p>\u63a5\u4e0b\u6765\u6211\u518d\u8bb2\u89e3\u4e00\u79cd\u901a\u8fc7C\u8bed\u8a00\u63a5\u53e3\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041953-6965c7e989cca.png\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041954-6965c7ea1689b.png\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041954-6965c7ea1fee1.png\" \/><\/p>\n<h4 id=\"S%EF%BC%9A%E5%A6%82%E4%BD%95%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%9F\">S&#xff1a;\u5982\u4f55\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf&#xff1f;<\/h4>\n<h4 id=\"1%E3%80%81%E4%B8%B4%E6%97%B6%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%88%E4%BB%85%E5%BD%93%E5%89%8D%E7%BB%88%E7%AB%AF%E4%BC%9A%E8%AF%9D%E7%94%9F%E6%95%88%EF%BC%89\">1\u3001\u4e34\u65f6\u6dfb\u52a0\u73af\u5883\u53d8\u91cf&#xff08;\u4ec5\u5f53\u524d\u7ec8\u7aef\u4f1a\u8bdd\u751f\u6548&#xff09;<\/h4>\n<p>\u57fa\u672c\u8bed\u6cd5&#xff1a;<\/p>\n<p>export \u73af\u5883\u53d8\u91cf\u540d&#061;\u503c<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13wxrtqul5fwi.png\" \/><\/p>\n<p>\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>export\u7684\u4f5c\u7528\u662f\u5c06\u53d8\u91cf\u6807\u8bb0\u4e3a \u201c\u73af\u5883\u53d8\u91cf\u201d&#xff0c;\u4f7f\u5b50\u8fdb\u7a0b\u53ef\u4ee5\u7ee7\u627f\u8be5\u53d8\u91cf&#xff1b;<\/li>\n<li>\u5173\u95ed\u7ec8\u7aef\u540e&#xff0c;\u8be5\u73af\u5883\u53d8\u91cf\u4f1a\u5931\u6548\u3002<\/li>\n<\/ul>\n<h4 id=\"2%E3%80%81%E6%B0%B8%E4%B9%85%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%88%E6%89%80%E6%9C%89%E7%BB%88%E7%AB%AF%E4%BC%9A%E8%AF%9D%E7%94%9F%E6%95%88%EF%BC%89\">2\u3001\u6c38\u4e45\u6dfb\u52a0\u73af\u5883\u53d8\u91cf&#xff08;\u6240\u6709\u7ec8\u7aef\u4f1a\u8bdd\u751f\u6548&#xff09;<\/h4>\n<p>\u9700\u5c06\u8bbe\u7f6e\u6307\u4ee4\u5199\u5165 Shell \u914d\u7f6e\u6587\u4ef6&#xff08;\u4ee5 Bash \u4e3a\u4f8b&#xff09;&#xff1a;<\/p>\n<p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>echo &#039;export \u73af\u5883\u53d8\u91cf\u540d&#061;\u503c&#039; &gt;&gt; ~\/.bashrc<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p>echo &#039;export MYENV&#061;&#034;hello world&#034;&#039; &gt;&gt; ~\/.bashrc<\/p>\n<p>\u2705\u00a0\u5f53\u524d\u7ec8\u7aef\u8fdb\u7a0b\u60f3\u7528\u65b0\u914d\u7f6e\u00a0\u2192 \u5fc5\u987b\u6267\u884c\u00a0source ~\/.bashrc&#xff08;\u76f8\u5f53\u4e8e \u201c\u7ed9\u5f53\u524d Shell\u2018\u5237\u65b0\u5185\u5b58\u2019\u201d&#xff09;&#xff1b;<\/p>\n<p>\u2705\u00a0\u4e0d\u60f3\u6267\u884c source\u00a0\u2192 \u76f4\u63a5\u5173\u95ed\u5f53\u524d\u7ec8\u7aef&#xff0c;\u91cd\u65b0\u6253\u5f00\u65b0\u7ec8\u7aef\u5373\u53ef&#xff08;\u65b0\u7ec8\u7aef\u542f\u52a8\u65f6\u4f1a\u81ea\u52a8\u8bfb\u53d6\u4fee\u6539\u540e\u7684~\/.bashrc&#xff09;\u3002<\/p>\n<p>\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>\u4e0d\u540c Shell \u5bf9\u5e94\u7684\u914d\u7f6e\u6587\u4ef6\u4e0d\u540c&#xff08;\u5982 Zsh \u5bf9\u5e94~\/.zshrc&#xff09;&#xff1b;<\/li>\n<li>\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u540e&#xff0c;\u65b0\u542f\u52a8\u7684\u7ec8\u7aef\u4f1a\u81ea\u52a8\u52a0\u8f7d\u8be5\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4 id=\"3%E3%80%81%E4%B8%B4%E6%97%B6%E5%8F%96%E6%B6%88%EF%BC%88%E4%BB%85%E5%BD%93%E5%89%8D%E7%BB%88%E7%AB%AF%E7%94%9F%E6%95%88%EF%BC%8C%E5%85%B3%E9%97%AD%E7%BB%88%E7%AB%AF%E5%8D%B3%E5%A4%B1%E6%95%88%EF%BC%89\">3\u3001\u4e34\u65f6\u53d6\u6d88&#xff08;\u4ec5\u5f53\u524d\u7ec8\u7aef\u751f\u6548&#xff0c;\u5173\u95ed\u7ec8\u7aef\u5373\u5931\u6548&#xff09;<\/h4>\n<p><span style=\"color:#38d8f0\">\u6838\u5fc3\u547d\u4ee4&#xff1a;unset<\/span><\/p>\n<p># \u53d6\u6d88\u5355\u4e2a\u73af\u5883\u53d8\u91cf&#xff08;\u6bd4\u5982\u4f60\u8bbe\u7f6e\u7684MYENV&#xff09;<br \/>\nunset MYENV<\/p>\n<p># \u9a8c\u8bc1\u662f\u5426\u53d6\u6d88&#xff1a;\u8f93\u51fa\u4e3a\u7a7a\u5219\u6210\u529f<br \/>\necho $MYENV<\/p>\n<p><span style=\"color:#38d8f0\">\u8865\u5145&#xff1a;\u6e05\u7a7a PATH&#xff08;\u614e\u7528&#xff01;&#xff09;<\/span><\/p>\n<p>\u5982\u679c\u60f3\u4e34\u65f6\u6e05\u7a7a\u67d0\u4e2a\u73af\u5883\u53d8\u91cf\u7684\u503c&#xff08;\u800c\u975e\u5f7b\u5e95\u53d6\u6d88&#xff09;&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u8d4b\u503c\u4e3a\u7a7a&#xff1a;<\/p>\n<p># \u4ec5\u6e05\u7a7a\u503c&#xff0c;\u53d8\u91cf\u4ecd\u5b58\u5728&#xff08;\u4e0d\u63a8\u8350&#xff0c;\u5bb9\u6613\u8e29\u5751&#xff09;<br \/>\nMYENV&#061;&#034;&#034;<br \/>\n# \u9a8c\u8bc1&#xff1a;\u8f93\u51fa\u4e3a\u7a7a&#xff0c;\u4f46\u53d8\u91cf\u8fd8\u5728<br \/>\nenv | grep MYENV  # \u4ecd\u80fd\u770b\u5230MYENV&#061;<\/p>\n<h4 id=\"4%E3%80%81%E6%B0%B8%E4%B9%85%E5%8F%96%E6%B6%88%EF%BC%88%E6%89%80%E6%9C%89%E7%BB%88%E7%AB%AF%E7%94%9F%E6%95%88%EF%BC%8C%E9%9C%80%E5%88%A0%E9%99%A4%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E5%AE%9A%E4%B9%89%EF%BC%89\">4\u3001\u6c38\u4e45\u53d6\u6d88&#xff08;\u6240\u6709\u7ec8\u7aef\u751f\u6548&#xff0c;\u9700\u5220\u9664\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u5b9a\u4e49&#xff09;<\/h4>\n<p>\u9488\u5bf9\u4f60\u4e4b\u524d\u5199\u5230~\/.bashrc\u91cc\u7684export MYENV&#061;&#034;hello world&#034;&#xff0c;\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/p>\n<p><span style=\"color:#4da8ee\">\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6&#xff0c;\u5220\u9664\u73af\u5883\u53d8\u91cf\u5b9a\u4e49&#xff1a;<\/span><\/p>\n<p># \u7528vim\u6253\u5f00~\/.bashrc<br \/>\nvim ~\/.bashrc<\/p>\n<p># \u64cd\u4f5c\u6b65\u9aa4&#xff1a;<br \/>\n# 1. \u6309G\u8df3\u5230\u6587\u4ef6\u6700\u540e\u4e00\u884c<br \/>\n# 2. \u627e\u5230\u4f60\u6dfb\u52a0\u7684export MYENV&#061;&#034;hello world&#034;\u8fd9\u4e00\u884c<br \/>\n# 3. \u6309dd\u5220\u9664\u8be5\u884c&#xff08;\u6216\u5728\u884c\u9996\u52a0#\u6ce8\u91ca\u6389&#xff09;<br \/>\n# 4. \u6309ESC \u2192 \u8f93\u5165:wq \u4fdd\u5b58\u9000\u51fa<\/p>\n<p><span style=\"color:#4da8ee\">\u8ba9\u4fee\u6539\u751f\u6548&#xff1a;<\/span><\/p>\n<p># \u5237\u65b0\u5f53\u524d\u7ec8\u7aef\u7684\u914d\u7f6e&#xff08;\u7acb\u5373\u6c38\u4e45\u53d6\u6d88&#xff0c;\u4e0d\u60f3\u7528\u8be5\u6307\u4ee4\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\u4e5f\u4f1a\u751f\u6548&#xff09;<br \/>\nsource ~\/.bashrc<\/p>\n<p># \u9a8c\u8bc1&#xff1a;\u65e0\u8bba\u5f53\u524d\u7ec8\u7aef\/\u65b0\u7ec8\u7aef&#xff0c;echo $MYENV \u90fd\u4e3a\u7a7a<br \/>\necho $MYENV  # \u8f93\u51fa\u7a7a <\/p>\n<hr \/>\n<h3 id=\"%E2%85%A3%E3%80%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E7%9A%84%E7%BB%A7%E6%89%BF%E6%80%A7%20%2B%20%E5%85%A8%E5%B1%80%E5%B1%9E%E6%80%A7%20%2B%E6%9C%AC%E5%9C%B0%E5%8F%98%E9%87%8F\">\u2163\u3001\u73af\u5883\u53d8\u91cf\u7684\u7ee7\u627f\u6027 &#043; \u5168\u5c40\u5c5e\u6027 &#043;\u672c\u5730\u53d8\u91cf<\/h3>\n<h4 id=\"1%E3%80%81%E7%BB%A7%E6%89%BF%E6%80%A7\">1\u3001\u7ee7\u627f\u6027<\/h4>\n<p>\u7236\u8fdb\u7a0b&#xff08;Shell&#xff09;\u901a\u8fc7export MYENV&#061;123456\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u540e&#xff0c;\u5b50\u8fdb\u7a0b&#xff08;.\/test\u7a0b\u5e8f&#xff09;\u80fd\u901a\u8fc7getenv\u7ee7\u627f\u5e76\u8bfb\u53d6\u8be5\u503c&#xff08;\u8fd0\u884c.\/test\u8f93\u51fa \u201c\u83b7\u53d6\u5230\u7684 MYENV \u503c&#xff1a;123456\u201d&#xff09;&#xff1b;<\/p>\n<h4 id=\"2%E3%80%81%E5%85%A8%E5%B1%80%E5%B1%9E%E6%80%A7\">2\u3001\u5168\u5c40\u5c5e\u6027<\/h4>\n<p>\u73af\u5883\u53d8\u91cf\u7684 \u201c\u5168\u5c40\u201d \u662f\u7236\u2192\u5b50\u8fdb\u7a0b\u94fe\u6761\u5185\u7684\u5355\u5411\u5171\u4eab&#xff1a;\u5b50\u8fdb\u7a0b\u4f1a\u7ee7\u627f\u7236\u8fdb\u7a0b\u7684\u73af\u5883\u53d8\u91cf&#xff0c;\u4f46\u5b50\u8fdb\u7a0b\u4fee\u6539\u7684\u662f\u72ec\u7acb\u526f\u672c&#xff0c;\u4e0d\u5f71\u54cd\u7236\u8fdb\u7a0b\u3002<\/p>\n<p><span style=\"color:#38d8f0\">\u5b50\u8fdb\u7a0b\u4f1a\u7ee7\u627f\u7236\u8fdb\u7a0b\u7684\u73af\u5883\u53d8\u91cf&#xff1a;<\/span><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13g1xltikxahz.png\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-132qhh1snluyb.png\" \/><\/p>\n<hr \/>\n<p><span style=\"color:#38d8f0\">\u5b50\u8fdb\u7a0b\u5bf9\u73af\u5883\u53d8\u91cf\u7684\u4fee\u6539\u4e0d\u5f71\u54cd\u7236\u8fdb\u7a0b&#xff1a;<\/span><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13g2054prozud.png\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13qhkvt4hamfd.png\" \/><\/p>\n<h4 id=\"Q%EF%BC%9A%E4%B8%BA%E5%95%A5%E5%AD%90%E8%BF%9B%E7%A8%8B%E4%BF%AE%E6%94%B9%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E4%B8%8D%E5%BD%B1%E5%93%8D%E7%88%B6%E8%BF%9B%E7%A8%8B%EF%BC%9F\"><span style=\"color:#38d8f0\">Q&#xff1a;<\/span>\u4e3a\u5565\u5b50\u8fdb\u7a0b\u4fee\u6539\u73af\u5883\u53d8\u91cf\u4e0d\u5f71\u54cd\u7236\u8fdb\u7a0b&#xff1f;<\/h4>\n<p>\u8fd9\u662f\u56e0\u4e3a\u8fdb\u7a0b\u7684\u73af\u5883\u53d8\u91cf\u662f \u201c\u590d\u5236\u7ee7\u627f\u201d \u800c\u975e \u201c\u5171\u4eab\u201d&#xff0c;\u5e95\u5c42\u903b\u8f91\u662f&#xff1a;\u5f53\u7236\u8fdb\u7a0b\u521b\u5efa\u5b50\u8fdb\u7a0b\u65f6&#xff0c;\u4f1a\u628a\u81ea\u5df1\u7684\u73af\u5883\u53d8\u91cf\u5b8c\u6574\u590d\u5236\u4e00\u4efd\u7ed9\u5b50\u8fdb\u7a0b \u2014\u2014 \u5b50\u8fdb\u7a0b\u62ff\u5230\u7684\u662f \u201c\u526f\u672c\u201d&#xff0c;\u4e0d\u662f\u548c\u7236\u8fdb\u7a0b\u5171\u4eab\u540c\u4e00\u4efd\u6570\u636e\u3002\u6240\u4ee5&#xff1a;<\/p>\n<ul>\n<li>\u5b50\u8fdb\u7a0b\u4fee\u6539\u7684\u662f \u201c\u81ea\u5df1\u7684\u526f\u672c\u201d&#xff0c;\u4e0d\u4f1a\u52a8\u5230\u7236\u8fdb\u7a0b\u7684\u539f\u59cb\u6570\u636e&#xff1b;<\/li>\n<li>\u5c31\u50cf\u4f60\u590d\u5236\u4e86\u4e00\u4efd\u6587\u4ef6&#xff0c;\u4fee\u6539\u526f\u672c\u4e0d\u4f1a\u5f71\u54cd\u539f\u6587\u4ef6&#xff0c;\u662f\u4e00\u4e2a\u9053\u7406\u3002<\/li>\n<\/ul>\n<h4 id=\"3%E3%80%81%E6%9C%AC%E5%9C%B0%E5%8F%98%E9%87%8F\">3\u3001\u672c\u5730\u53d8\u91cf<\/h4>\n<p>\u672c\u5730\u53d8\u91cf\u662f\u4ec5\u5728\u5f53\u524d Bash \u8fdb\u7a0b\u5185\u751f\u6548\u7684\u53d8\u91cf&#xff08;\u4e0d\u52a0export\u7684\u53d8\u91cf&#xff09;&#xff0c;\u4e0d\u4f1a\u88ab Bash \u7684\u5b50\u8fdb\u7a0b\u7ee7\u627f\u3002<\/p>\n<p><span style=\"color:#a2e043\">\u8bc1\u660e\u672c\u5730\u53d8\u91cf\u4e0d\u4f1a\u88ab\u7ee7\u627f&#xff1a;<\/span><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13azcvkc0cqfy.png\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13vpzn3y0teaa.png\" \/><\/p>\n<h4 id=\"4%E3%80%81%E5%86%85%E5%BB%BA%E5%91%BD%E4%BB%A4%E5%92%8C%E5%B8%B8%E8%A7%84%E5%91%BD%E4%BB%A4\">4\u3001\u5185\u5efa\u547d\u4ee4\u548c\u5e38\u89c4\u547d\u4ee4<\/h4>\n<p>\u4e4b\u524d\u6211\u4eec\u8ba4\u4e3a \u201c\u6240\u6709\u547d\u4ee4\u90fd\u4f1a\u4ee5 Bash \u8fdb\u7a0b\u7684\u5b50\u8fdb\u7a0b\u5f62\u5f0f\u6267\u884c\u201d&#xff0c;\u8fd9\u4e2a\u8bf4\u6cd5\u5176\u5b9e\u4e0d\u51c6\u786e\u3002\u5b9e\u9645\u4f7f\u7528\u4e2d&#xff0c;Shell \u547d\u4ee4\u53ef\u4ee5\u5206\u4e3a\u4e24\u7c7b&#xff1a;\u5e38\u89c4\u547d\u4ee4\u548c\u5185\u5efa\u547d\u4ee4\u3002<\/p>\n<p>1. \u5e38\u89c4\u547d\u4ee4<\/p>\n<p>\u5e38\u89c4\u547d\u4ee4\u7684\u6267\u884c&#xff0c;\u662f\u901a\u8fc7\u521b\u5efa\u5b50\u8fdb\u7a0b\u6765\u5b8c\u6210\u7684\u2014\u2014 \u8fd9\u4e9b\u547d\u4ee4\u662f\u72ec\u7acb\u7684\u7a0b\u5e8f&#xff0c;Bash \u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u7684\u5b50\u8fdb\u7a0b&#xff0c;\u8ba9\u5b50\u8fdb\u7a0b\u53bb\u8fd0\u884c\u8fd9\u4e2a\u7a0b\u5e8f&#xff0c;\u7a0b\u5e8f\u8dd1\u5b8c\u5b50\u8fdb\u7a0b\u5c31\u7ed3\u675f\u3002<\/p>\n<p>2. \u5185\u5efa\u547d\u4ee4<\/p>\n<p>\u5185\u5efa\u547d\u4ee4\u7684\u6267\u884c&#xff0c;Bash\u00a0\u4e0d\u4f1a\u521b\u5efa\u5b50\u8fdb\u7a0b&#xff0c;\u800c\u662f\u7531 Bash \u81ea\u5df1\u76f4\u63a5\u6267\u884c \u2014\u2014 \u76f8\u5f53\u4e8e Bash \u8c03\u7528\u4e86\u81ea\u5df1\u5185\u7f6e\u7684\u529f\u80fd&#xff08;\u7c7b\u4f3c Bash \u81ea\u5df1\u5199\u597d\u7684\u51fd\u6570&#xff09;&#xff0c;\u4e0d\u7528\u989d\u5916\u5f00\u65b0\u8fdb\u7a0b\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13uacuu3uefcm.png\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13oafeni4xfyp.png\" \/><\/p>\n<p>\u6267\u884c.\/test&#xff08;\u5e38\u89c4\u547d\u4ee4&#xff09;\u65f6&#xff0c;Bash \u4f1a\u521b\u5efa\u5b50\u8fdb\u7a0b&#xff0c;\u4f46\u7236\u8fdb\u7a0b\u7684\u672c\u5730\u53d8\u91cf\u4e0d\u4f1a\u4f20\u7ed9\u5b50\u8fdb\u7a0b&#xff0c;\u6240\u4ee5.\/test\u8bfb\u4e0d\u5230MYENV&#xff1b;<\/p>\n<p>\u800cecho\u662f\u5185\u5efa\u547d\u4ee4&#xff0c;\u6267\u884c\u65f6 Bash \u4e0d\u4f1a\u5f00\u5b50\u8fdb\u7a0b&#xff0c;\u76f4\u63a5\u5728\u81ea\u8eab\u8fdb\u7a0b\u5185\u8fd0\u884c&#xff0c;\u56e0\u6b64\u80fd\u8bbf\u95ee\u5230\u7236\u8fdb\u7a0b\u7684\u672c\u5730\u53d8\u91cf&#xff0c;\u6240\u4ee5echo $MYENV\u80fd\u8f93\u51fa123\u3002<\/p>\n<hr \/>\n<h4 id=\"%E3%80%90%E6%A8%A1%E6%8B%9Fcd%E5%86%85%E5%BB%BA%E6%8C%87%E4%BB%A4%E3%80%91\">\u3010\u6a21\u62dfcd\u5185\u5efa\u6307\u4ee4\u3011<\/h4>\n<p>\u5728 Shell \u4e2d&#xff0c;cd\u662f\u5185\u5efa\u6307\u4ee4&#xff0c;\u5b83\u7684\u5e95\u5c42\u662f\u901a\u8fc7chdir\u7cfb\u7edf\u8c03\u7528\u51fd\u6570\u5b9e\u73b0\u7684\u3002<\/p>\n<p><span style=\"color:#a2e043\">chdir\u51fd\u6570<\/span><\/p>\n<ul>\n<li>\u51fd\u6570\u539f\u578b&#xff1a;int chdir(const char *path);<\/li>\n<li>\u529f\u80fd&#xff1a;\u7528\u4e8e\u4fee\u6539\u5f53\u524d\u8fdb\u7a0b\u7684\u5de5\u4f5c\u76ee\u5f55\u3002<\/li>\n<li>\u53c2\u6570path&#xff1a;\u5b57\u7b26\u4e32\u5f62\u5f0f\u7684\u76ee\u6807\u8def\u5f84&#xff08;\u652f\u6301\u7edd\u5bf9\u8def\u5f84 \/ \u76f8\u5bf9\u8def\u5f84&#xff09;\u3002<\/li>\n<li>\u8fd4\u56de\u503c&#xff1a;\n<ul>\n<li>\u6210\u529f&#xff1a;\u8fd4\u56de0&#xff1b;<\/li>\n<li>\u5931\u8d25&#xff1a;\u8fd4\u56de-1&#xff0c;\u540c\u65f6\u4f1a\u8bbe\u7f6eerrno\u6807\u8bc6\u9519\u8bef\u539f\u56e0<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>#include &lt;unistd.h&gt;<br \/>\n#include &lt;stdio.h&gt;<\/p>\n<p>int main(int argc, char *argv[], char *envp[])<br \/>\n{<br \/>\n    sleep(20); \/\/ \u5ef6\u8fdf&#xff0c;\u65b9\u4fbf\u89c2\u5bdf\u8fdb\u7a0b\u72b6\u6001<br \/>\n    printf(&#034;change begin\\\\n&#034;);<br \/>\n    if (argc &#061;&#061; 2)  \/\/ \u63a5\u6536\u547d\u4ee4\u884c\u53c2\u6570\u4f5c\u4e3a\u76ee\u6807\u8def\u5f84<br \/>\n    {<br \/>\n        chdir(argv[1]); \/\/ \u8c03\u7528chdir\u4fee\u6539\u5f53\u524d\u8fdb\u7a0b\u7684\u5de5\u4f5c\u76ee\u5f55<br \/>\n    }<br \/>\n    sleep(20);<br \/>\n    return 0;<br \/>\n} <\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13aicxzsdtn0r.png\" \/><\/p>\n<p>\u7b2c\u4e00\u6b21&#xff08;change begin\u524d&#xff09;&#xff1a;\u6307\u5411\u7684\u662f\u539f\u76ee\u5f55\/home\/lih\/code-under-linux\/Test-course&#xff1b;<\/p>\n<p>\u7b2c\u4e8c\u6b21&#xff08;change begin\u540e&#xff09;&#xff1a;\u6307\u5411\u7684\u662f\u76ee\u6807\u76ee\u5f55\/home\/lih\u2014\u2014 \u8bf4\u660echdir\u786e\u5b9e\u6210\u529f\u4fee\u6539\u4e86\u5b50\u8fdb\u7a0b\u7684\u5de5\u4f5c\u76ee\u5f55&#xff01;<\/p>\n<p><span style=\"color:#38d8f0\">ls -ld \/proc\/[\u8fdb\u7a0bID]\/cwd<\/span><\/p>\n<p>\u4f5c\u7528&#xff1a;\u67e5\u770bcwd&#xff08;\u8fdb\u7a0b\u5de5\u4f5c\u76ee\u5f55\u7684\u8f6f\u94fe\u63a5&#xff09;\u81ea\u8eab\u4fe1\u606f<\/p>\n<p>\u6211\u7684\u535a\u5ba2\u5373\u5c06\u540c\u6b65\u81f3\u817e\u8baf\u4e91\u5f00\u53d1\u8005\u793e\u533a&#xff0c;\u9080\u8bf7\u5927\u5bb6\u4e00\u540c\u5165\u9a7b&#xff1a;https:\/\/cloud.tencent.com\/developer\/support-plan?invite_code&#061;4u7xbz032vy<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"2026-01-13etmv4ctnkqp.png\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.2k\u6b21\uff0c\u70b9\u8d5e108\u6b21\uff0c\u6536\u85cf79\u6b21\u3002\u9488\u5bf9\u4f60\u4e4b\u524d\u5199\u5230~\/.bashrc\u91cc\u7684\uff0c\u64cd\u4f5c\u6b65\u9aa4\uff1a# \u7528vim\u6253\u5f00~\/.bashrc# \u64cd\u4f5c\u6b65\u9aa4\uff1a# 1. \u6309G\u8df3\u5230\u6587\u4ef6\u6700\u540e\u4e00\u884c# 2. \u627e\u5230\u4f60\u6dfb\u52a0\u7684export MYENV=&quot;hello world&quot;\u8fd9\u4e00\u884c# 3. \u6309dd\u5220\u9664\u8be5\u884c\uff08\u6216\u5728\u884c\u9996\u52a0#\u6ce8\u91ca\u6389\uff09# 4. \u6309ESC \u2192 \u8f93\u5165:wq \u4fdd\u5b58\u9000\u51fa# \u5237\u65b0\u5f53\u524d\u7ec8\u7aef\u7684\u914d\u7f6e\uff08\u7acb\u5373\u6c38\u4e45\u53d6\u6d88\uff0c\u4e0d\u60f3\u7528\u8be5\u6307\u4ee4\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\u4e5f\u4f1a\u751f\u6548\uff09# \u9a8c\u8bc1\uff1a\u65e0\u8bba\u5f53\u524d\u7ec8\u7aef\/\u65b0\u7ec8\u7aef\uff0cecho $MYENV \u90fd\u4e3a\u7a7aecho $MYENV # \u8f93\u51fa\u7a7a\u3002<\/p>\n","protected":false},"author":2,"featured_media":59088,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-59108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf - \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\/59108.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.2k\u6b21\uff0c\u70b9\u8d5e108\u6b21\uff0c\u6536\u85cf79\u6b21\u3002\u9488\u5bf9\u4f60\u4e4b\u524d\u5199\u5230~\/.bashrc\u91cc\u7684\uff0c\u64cd\u4f5c\u6b65\u9aa4\uff1a# \u7528vim\u6253\u5f00~\/.bashrc# \u64cd\u4f5c\u6b65\u9aa4\uff1a# 1. \u6309G\u8df3\u5230\u6587\u4ef6\u6700\u540e\u4e00\u884c# 2. \u627e\u5230\u4f60\u6dfb\u52a0\u7684export MYENV=&quot;hello world&quot;\u8fd9\u4e00\u884c# 3. \u6309dd\u5220\u9664\u8be5\u884c\uff08\u6216\u5728\u884c\u9996\u52a0#\u6ce8\u91ca\u6389\uff09# 4. \u6309ESC \u2192 \u8f93\u5165:wq \u4fdd\u5b58\u9000\u51fa# \u5237\u65b0\u5f53\u524d\u7ec8\u7aef\u7684\u914d\u7f6e\uff08\u7acb\u5373\u6c38\u4e45\u53d6\u6d88\uff0c\u4e0d\u60f3\u7528\u8be5\u6307\u4ee4\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\u4e5f\u4f1a\u751f\u6548\uff09# \u9a8c\u8bc1\uff1a\u65e0\u8bba\u5f53\u524d\u7ec8\u7aef\/\u65b0\u7ec8\u7aef\uff0cecho $MYENV \u90fd\u4e3a\u7a7aecho $MYENV # \u8f93\u51fa\u7a7a\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/59108.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-13T04:19:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041948-6965c7e4cc5c9.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59108.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/59108.html\",\"name\":\"\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-13T04:19:55+00:00\",\"dateModified\":\"2026-01-13T04:19:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/59108.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/59108.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59108.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf\"}]},{\"@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":"\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf - \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\/59108.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.2k\u6b21\uff0c\u70b9\u8d5e108\u6b21\uff0c\u6536\u85cf79\u6b21\u3002\u9488\u5bf9\u4f60\u4e4b\u524d\u5199\u5230~\/.bashrc\u91cc\u7684\uff0c\u64cd\u4f5c\u6b65\u9aa4\uff1a# \u7528vim\u6253\u5f00~\/.bashrc# \u64cd\u4f5c\u6b65\u9aa4\uff1a# 1. \u6309G\u8df3\u5230\u6587\u4ef6\u6700\u540e\u4e00\u884c# 2. \u627e\u5230\u4f60\u6dfb\u52a0\u7684export MYENV=&quot;hello world&quot;\u8fd9\u4e00\u884c# 3. \u6309dd\u5220\u9664\u8be5\u884c\uff08\u6216\u5728\u884c\u9996\u52a0#\u6ce8\u91ca\u6389\uff09# 4. \u6309ESC \u2192 \u8f93\u5165:wq \u4fdd\u5b58\u9000\u51fa# \u5237\u65b0\u5f53\u524d\u7ec8\u7aef\u7684\u914d\u7f6e\uff08\u7acb\u5373\u6c38\u4e45\u53d6\u6d88\uff0c\u4e0d\u60f3\u7528\u8be5\u6307\u4ee4\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\u4e5f\u4f1a\u751f\u6548\uff09# \u9a8c\u8bc1\uff1a\u65e0\u8bba\u5f53\u524d\u7ec8\u7aef\/\u65b0\u7ec8\u7aef\uff0cecho $MYENV \u90fd\u4e3a\u7a7aecho $MYENV # \u8f93\u51fa\u7a7a\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/59108.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-13T04:19:55+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113041948-6965c7e4cc5c9.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/59108.html","url":"https:\/\/www.wsisp.com\/helps\/59108.html","name":"\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-13T04:19:55+00:00","dateModified":"2026-01-13T04:19:55+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/59108.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/59108.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/59108.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux\u3011\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\u3001\u8fdb\u7a0b\u5207\u6362\u3001\u73af\u5883\u53d8\u91cf"}]},{"@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\/59108","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=59108"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/59108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/59088"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=59108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=59108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=59108"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=59108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}