{"id":86580,"date":"2026-07-28T22:16:38","date_gmt":"2026-07-28T14:16:38","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/86580.html"},"modified":"2026-07-28T22:16:38","modified_gmt":"2026-07-28T14:16:38","slug":"%e3%80%90linux%e7%b3%bb%e7%bb%9f%e7%bc%96%e7%a8%8b%e3%80%91%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%8f%82%e6%95%b0%e5%92%8c%e7%8e%af%e5%a2%83%e5%8f%98%e9%87%8f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/86580.html","title":{"rendered":"\u3010Linux\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\u73af\u5883\u53d8\u91cf"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"-toc\" style=\"margin-left:0px\">\n<p id=\"1.%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8F%82%E6%95%B0-toc\" style=\"margin-left:0px\">1.\u547d\u4ee4\u884c\u53c2\u6570<\/p>\n<p id=\"2.%20%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F-toc\" style=\"margin-left:0px\">2. \u73af\u5883\u53d8\u91cf<\/p>\n<p id=\"2.1%20%E6%A6%82%E5%BF%B5-toc\" style=\"margin-left:40px\">2.1 \u6982\u5ff5<\/p>\n<p id=\"2.2%20Linux%E4%B8%AD%E7%9A%84%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F-toc\" style=\"margin-left:40px\">2.2 Linux\u4e2d\u7684\u73af\u5883\u53d8\u91cf<\/p>\n<p id=\"2.2.1%20%E5%B8%B8%E8%A7%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F-toc\" style=\"margin-left:80px\">2.2.1 \u5e38\u89c1\u73af\u5883\u53d8\u91cf<\/p>\n<p id=\"2.2.2%C2%A0%E8%8E%B7%E5%8F%96%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E7%9A%84%E6%96%B9%E6%B3%95-toc\" style=\"margin-left:80px\">2.2.2\u00a0\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5<\/p>\n<p id=\"%E2%80%8B%E7%BC%96%E8%BE%91-toc\" style=\"margin-left:80px\">\u200b<\/p>\n<p id=\"3.%E7%90%86%E8%A7%A3%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E7%9A%84%E4%BA%A7%E7%94%9F-toc\" style=\"margin-left:0px\">3.\u7406\u89e3\u73af\u5883\u53d8\u91cf\u7684\u4ea7\u751f<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"1.%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8F%82%E6%95%B0\">1.\u547d\u4ee4\u884c\u53c2\u6570<\/h2>\n<p>\u76f4\u63a5\u4e0a\u4ee3\u7801\u6f14\u793a&#xff1a;<\/p>\n<p>  1 #include&lt;stdio.h&gt;<br \/>\n  2<br \/>\n  3 int main(int argc,char* argv[]) \/\/int main(int argc, char **argv)  \u6307\u9488\u5f62\u5f0f&#xff0c;\u5b8c\u5168\u7b49\u4ef7<br \/>\n  4 {<br \/>\n  5     printf(&#034;\u53c2\u6570\u4e2a\u6570: %d\\\\n&#034;, argc);<br \/>\n  6<br \/>\n  7     for (int i &#061; 0; i &lt; argc; i&#043;&#043;)<br \/>\n  8     {<br \/>\n  9         printf(&#034;argv[%d] &#061; %s\\\\n&#034;, i, argv[i]);<br \/>\n 10     }<br \/>\n 11     return 0;<br \/>\n 12 }<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"216\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141635-6a68b9c306ad0.png\" width=\"868\" \/><\/p>\n<ul>\n<li>\n<p>argv[0]\u00a0\u6c38\u8fdc\u5b58\u5728&#xff0c;\u81f3\u5c11\u4e3a 1\u3002<\/p>\n<\/li>\n<li>\n<p>argv[argc]\u00a0\u56fa\u5b9a\u4e3a NULL&#xff0c;\u4e5f\u5c31\u662f\u8bf4\u6700\u540e\u4e00\u5b9a\u4ee5\u7a7a\u6307\u9488\u7ed3\u5c3e<\/p>\n<\/li>\n<\/ul>\n<p>argc\u00a0\u662f\u547d\u4ee4\u884c\u53c2\u6570\u7684\u4e2a\u6570&#xff0c;argv\u00a0\u662f\u53c2\u6570\u5b57\u7b26\u4e32\u6570\u7ec4&#xff0c;\u5b83\u4eec\u8ba9\u4f60\u53ef\u4ee5\u5728\u7a0b\u5e8f\u542f\u52a8\u65f6\u4f20\u5165\u914d\u7f6e\u548c\u6570\u636e&#xff0c;\u4f1a\u4ee5\u7a7a\u683c\u6587\u5206\u9694\u7b26&#xff0c;\u4ece\u952e\u76d8\u8bfb\u53d6\u3002<\/p>\n<p>\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u53ef\u4ee5\u5b9e\u73b0\u591a\u9009\u9879\u529f\u80fd&#xff1a;<\/p>\n<p>  1 #include&lt;stdio.h&gt;<br \/>\n  2 #include&lt;string.h&gt;<br \/>\n  3<br \/>\n  4 int main(int argc,char* argv[])<br \/>\n  5 {<br \/>\n  6     for (int i &#061; 0; i &lt; argc; i&#043;&#043;)<br \/>\n  7     {<br \/>\n  8         if (strcmp(argv[i], &#034;-l&#034;) &#061;&#061; 0) { printf(&#034;Version1\\\\n&#034;); }<br \/>\n  9         else if (strcmp(argv[i], &#034;-p&#034;) &#061;&#061; 0) { printf(&#034;Version2\\\\n&#034;); }<br \/>\n 10     }<br \/>\n 11<br \/>\n 12     return 0;<br \/>\n 13 }<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"227\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141635-6a68b9c35d814.png\" width=\"1060\" \/><\/p>\n<h2 id=\"2.%20%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\">2. \u73af\u5883\u53d8\u91cf<\/h2>\n<h3 id=\"2.1%20%E6%A6%82%E5%BF%B5\">2.1 \u6982\u5ff5<\/h3>\n<p>\u73af\u5883\u53d8\u91cf&#xff08;Environment Variables&#xff09;\u00a0\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u4e86\u7b80\u5316\u7a0b\u5e8f\u914d\u7f6e\u800c\u8bbe\u8ba1\u7684\u5168\u5c40\u952e\u503c\u5bf9\u673a\u5236&#xff0c;\u662f\u7cfb\u7edf\u7ea7\u53d8\u91cf&#xff0c;\u4fdd\u5b58\u548c\u7cfb\u7edf\u542f\u52a8\u548c\u8fd0\u884c\u7684\u6838\u5fc3\u53c2\u6570&#xff0c;\u5177\u6709\u5168\u5c40\u6027\u3002<\/p>\n<h3 id=\"2.2%20Linux%E4%B8%AD%E7%9A%84%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\">2.2 Linux\u4e2d\u7684\u73af\u5883\u53d8\u91cf<\/h3>\n<h4 id=\"2.2.1%20%E5%B8%B8%E8%A7%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\">2.2.1 \u5e38\u89c1\u73af\u5883\u53d8\u91cf<\/h4>\n<p>PATH : \u6307\u5b9a\u547d\u4ee4\u7684\u641c\u7d22\u8def\u5f84 HOME : \u6307\u5b9a\u7528\u6237\u7684\u4e3b\u5de5\u4f5c\u76ee\u5f55(\u5373\u7528\u6237\u767b\u9646\u5230Linux\u7cfb\u7edf\u4e2d\u65f6,\u9ed8\u8ba4\u7684\u76ee\u5f55) SHELL : \u5f53\u524dShell,\u5b83\u7684\u503c\u901a\u5e38\u662f\/bin\/bash<\/p>\n<p>echo $NAME   #\u53ef\u4ee5\u67e5\u770b\u914d\u7f6e\u7684\u73af\u5883\u53d8\u91cf <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"188\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141635-6a68b9c382348.png\" width=\"1155\" \/><\/p>\n<p>\u8bf4\u660e&#xff1a;.\/code \u80fd\u591f\u6267\u884c&#xff0c;code\u4e0d\u80fd\u6267\u884c\u7684\u539f\u56e0\u5c31\u662f\u6ca1\u6709\u6307\u5b9a\u8def\u5f84&#xff0c;\u800cls&#xff0c;pwd&#xff0c;which\u5728\u4efb\u4f55\u5730\u65b9\u90fd\u80fd\u6267\u884c\u5c31\u662f\u56e0\u4e3a\u914d\u7f6e\u4e86\u73af\u5883\u53d8\u91cf&#xff0c;\u6240\u4ee5which\u7684\u672c\u8d28\u5c31\u662f\u67e5\u627e\u5bf9\u5e94\u7684\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<p>PATH\u4e2d\u6dfb\u52a0\u73af\u5883\u53d8\u91cf<\/p>\n<p>PATH&#061;$PATH:[\u6dfb\u52a0\u7684\u8def\u5f84]  <\/p>\n<p>\u5982\u679c\u6211\u4eec\u5c06\/home\/yyx\/lesonenvivar20\u6dfb\u52a0\u5230PATH\u5f53\u4e2d&#xff0c;code\u5c31\u80fd\u591f\u6267\u884c\u4e86\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"134\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141635-6a68b9c3a318b.png\" width=\"1102\" \/><\/p>\n<p>\u6ce8\u610f&#xff1a;\u5982\u679c\u76f4\u63a5PATH&#061;&#034;XXXX&#034;&#xff0c;\u539f\u5185\u5bb9\u4f1a\u88abXXXX\u8986\u76d6&#xff0c;\u4e0d\u8fc7\u4ec5\u4ec5\u662f\u505a\u5185\u5b58\u7ea7\u4fee\u6539&#xff0c;\u9000\u51fa\u91cd\u65b0\u767b\u9646\u540e\u4f1a\u6062\u590d\u3002<\/p>\n<p>env   #\u67e5\u770b\u5168\u90e8\u7684\u73af\u5883\u53d8\u91cf&#xff0c;\u4e0d\u542b\u672c\u5730\u53d8\u91cf <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"992\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141635-6a68b9c3bf628.png\" width=\"2536\" \/><\/p>\n<p>\u6bd4\u5982\u5176\u4e2d\u7684HISTSIZE&#061;1000&#xff0c;\u8bf4\u7684\u5c31\u662f\u53ea\u8bb0\u5f55\u6700\u8fd1\u4f7f\u7528\u7684\u5386\u53f2\u547d\u4ee41000\u6761&#xff0c;history\u53ef\u4ee5\u67e5\u770b\u3002<\/p>\n<p>OLDPWD\u5c31\u662f\u6700\u8fd1\u4e0a\u4e00\u6b21\u7684\u8def\u5f84&#xff0c;cd-\u5c31\u662f\u901a\u8fc7\u5b83\u6765\u5b9e\u73b0\u7684\u3002<\/p>\n<h4 id=\"2.2.2%C2%A0%E8%8E%B7%E5%8F%96%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E7%9A%84%E6%96%B9%E6%B3%95\">2.2.2\u00a0\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5<\/h4>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:600px\">\n<tbody>\n<tr>\u65b9\u5f0f\u8bf4\u660e\u793a\u4f8b<\/tr>\n<tr>\n<td>environ\u00a0\u5168\u5c40\u53d8\u91cf<\/td>\n<td>\u76f4\u63a5\u64cd\u4f5c\u6574\u4e2a\u73af\u5883\u53d8\u91cf\u6570\u7ec4<\/td>\n<td>extern char **environ;<\/td>\n<\/tr>\n<tr>\n<td>getenv()\u00a0\u51fd\u6570<\/td>\n<td>\u901a\u8fc7\u952e\u540d\u83b7\u53d6\u5355\u4e2a\u503c&#xff0c;\u6700\u5e38\u7528<\/td>\n<td>getenv(&#034;PATH&#034;)<\/td>\n<\/tr>\n<tr>\n<td>main()\u00a0\u7684\u00a0envp\u00a0\u53c2\u6570<\/td>\n<td>\u901a\u8fc7\u00a0main\u00a0\u51fd\u6570\u7684\u7b2c\u4e09\u4e2a\u53c2\u6570\u63a5\u6536<\/td>\n<td>int main(int argc, char *argv[], char *envp[])<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>environ\u7684\u7528\u6cd5&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<\/p>\n<p>extern char **environ;  \/\/ \u58f0\u660e\u5916\u90e8\u53d8\u91cf<\/p>\n<p>int main() {<br \/>\n    char **env &#061; environ;<br \/>\n    while (*env !&#061; NULL) {<br \/>\n        printf(&#034;%s\\\\n&#034;, *env);<br \/>\n        env&#043;&#043;;<br \/>\n    }<br \/>\n    return 0;<br \/>\n} <\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7C\u5e93\u51fd\u6570\u63d0\u4f9b\u7684getenv\u6765\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<p>  1 #include &lt;stdio.h&gt;<br \/>\n  2 #include &lt;stdlib.h&gt;<br \/>\n  3<br \/>\n  4 int main()<br \/>\n  5  {<br \/>\n  6     \/\/   \u83b7\u53d6HOME<br \/>\n  7     char *home &#061; getenv(&#034;HOME&#034;);<br \/>\n  8     if (home !&#061; NULL) {<br \/>\n  9         printf(&#034;HOME &#061; %s\\\\n&#034;, home);<br \/>\n 10     }<br \/>\n 11<br \/>\n 12     \/\/  \u83b7\u53d6 PATH<br \/>\n 13     char *path &#061; getenv(&#034;PATH&#034;);<br \/>\n 14     if (path !&#061; NULL) {<br \/>\n 15         printf(&#034;PATH &#061; %s\\\\n&#034;, path);<br \/>\n 16     }<br \/>\n 17<br \/>\n 18     return 0;<br \/>\n 19 }<br \/>\nexport    #\u8bbe\u7f6e\u65b0\u7684\u73af\u5883\u53d8\u91cf&#xff0c;\u4e5f\u53ef\u4ee5\u5c06\u672c\u5730\u53d8\u91cf\u4fee\u6539\u4e3a\u73af\u5883\u53d8\u91cf<br \/>\nset       #\u663e\u793a\u672c\u5730\u5b9a\u4e49\u7684shell\u53d8\u91cf\u548c\u73af\u5883\u53d8\u91cf<br \/>\nunset     #\u6e05\u695a\u73af\u5883\u53d8\u91cf<br \/>\necho$     #\u663e\u793a\u53d8\u91cf\u7684\u503c<br \/>\n[\u53d8\u91cf\u540d]&#061;[]  #\u5b9a\u4e49\u672c\u5730\u53d8\u91cf&#xff0c;\u53ea\u5728bash\u5185\u90e8\u6709\u6548&#xff0c;\u5b50\u8fdb\u7a0b\u4e0d\u7ee7\u627f&#xff0c;\u7b49\u53f7\u4e24\u8fb9\u4e0d\u80fd\u6709\u7a7a\u683c <\/p>\n<h4 id=\"%E2%80%8B%E7%BC%96%E8%BE%91\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"241\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141636-6a68b9c4bcb19.png\" width=\"876\" \/><\/h4>\n<h4>2.2.3 getenv\u7684\u4e09\u79cd\u7528\u6cd5<\/h4>\n<p>putenv(&#034;MY_VAR&#061;hello&#034;);  #\u6dfb\u52a0\u65b0\u73af\u5883\u53d8\u91cf&#xff08;\u4e0d\u5b58\u5728\u65f6&#xff09;<\/p>\n<p>putenv(&#034;PATH&#061;\/custom\/bin&#034;);   #\u4fee\u6539\u5df2\u6709\u73af\u5883\u53d8\u91cf&#xff08;\u5b58\u5728\u65f6&#xff09;<\/p>\n<p>putenv(&#034;MY_VAR&#034;);    #\u5220\u9664\u73af\u5883\u53d8\u91cf&#xff08;\u4f20\u5165\u4e0d\u5e26 &#061; \u7684\u5b57\u7b26\u4e32&#xff09; <\/p>\n<\/p>\n<h2 id=\"3.%E7%90%86%E8%A7%A3%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E7%9A%84%E4%BA%A7%E7%94%9F\">3.\u7406\u89e3\u73af\u5883\u53d8\u91cf\u7684\u4ea7\u751f<\/h2>\n<p>\u7ed3\u8bba&#xff1a;\u4efb\u4f55\u8fdb\u7a0b\u7684\u542f\u52a8&#xff0c;\u90fd\u4f1a\u5b58\u5728\u4e24\u5f20\u8868<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1.\u547d\u4ee4\u884c\u53c2\u6570\u8868<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2.\u73af\u5883\u53d8\u91cf\u8868<\/p>\n<p>\u547d\u4ee4\u884c\u53c2\u6570\u8868&#xff1a;\u5f53\u5728shell\u547d\u4ee4\u884c\u8f93\u5165\u547d\u4ee4\u5b57\u7b26\u4e32\u65f6&#xff0c;\u901a\u8fc7\u89e3\u6790\u6784\u5efaargv\u6570\u7ec4&#xff0c;\u4e5f\u5c31\u662f\u547d\u4ee4\u884c\u53c2\u6570\u8868&#xff0c;\u6700\u540e\u4ee5NULL\u7ed3\u675f\u3002<\/p>\n<p>\u73af\u5883\u53d8\u91cf\u8868&#xff1a;\u5f53\u4e00\u4e2a\u8fdb\u7a0b\u542f\u52a8\u65f6&#xff0c;\u4ed6\u4f1a\u4ece\u7279\u5b9a\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bfb\u53d6\u73af\u5883\u53d8\u91cf&#xff0c;\u7136\u540e\u6784\u5efa\u73af\u5883\u53d8\u91cf\u8868char* env[]&#xff0c;\u5982\u679c\u5b83\u7ee7\u7eed\u521b\u5efa\u5b50\u8fdb\u7a0b\u7684\u8bdd&#xff0c;\u5b50\u8fdb\u7a0b\u4f1a\u201c\u7ee7\u627f\u201d\u4e0b\u6765\u8fd9\u4e9b\u73af\u5883\u53d8\u91cf&#xff0c;\u5728\u521b\u5efa&#xff0c;\u5728\u7ee7\u627f&#xff0c;\u6240\u4ee5\u73af\u5883\u53d8\u91cf\u5177\u6709\u5168\u5c40\u5c5e\u6027\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"47\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141636-6a68b9c4dbbec.png\" width=\"719\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"32\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141636-6a68b9c4ea1b4.png\" width=\"360\" \/><\/p>\n<p>\u6bcf\u4e00\u6b21\u767b\u9646\u65f6&#xff0c;\u4f1a\u8d70\u4e0a\u9762\u8fd9\u4e2a\u8def\u5f84\u626b\u63cf\u6587\u4ef6\u83b7\u53d6\u73af\u5883\u53d8\u91cf&#xff0c;\u5982\u679c\u5728\u7279\u5b9a\u6587\u4ef6\u5185\u90e8\u505a\u4fee\u6539&#xff0c;\u589e\u52a0\u73af\u5883\u53d8\u91cf&#xff0c;\u6b64\u65f6\u5c31\u4e0d\u5355\u5355\u662f\u5185\u5b58\u7ea7\u4fee\u6539&#xff0c;\u4e0b\u6b21\u767b\u9646\u65f6\u4e0d\u518d\u6062\u590d\u3002<\/p>\n<\/p>\n<p>\u5b8c~<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55 1.\u547d\u4ee4\u884c\u53c2\u6570<br \/>\n2. \u73af\u5883\u53d8\u91cf<br \/>\n2.1 \u6982\u5ff5<br \/>\n2.2 Linux\u4e2d\u7684\u73af\u5883\u53d8\u91cf<br \/>\n2.2.1 \u5e38\u89c1\u73af\u5883\u53d8\u91cf<br \/>\n2.2.2\u00a0\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5<br \/>\n\u200b<br \/>\n3.\u7406\u89e3\u73af\u5883\u53d8\u91cf\u7684\u4ea7\u751f 1.\u547d\u4ee4\u884c\u53c2\u6570<br \/>\n\u76f4\u63a5\u4e0a\u4ee3\u7801\u6f14\u793a&#xff1a; 1 #include2 3 int main(int argc,char* argv[]) \/\/int main(int argc, char **argv)  \u6307\u9488\u5f62\u5f0f&#xff0c;\u5b8c\u5168\u7b49\u4ef74 {5     printf(\\&#8221;<\/p>\n","protected":false},"author":2,"featured_media":86572,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9099,58,43,44],"topic":[],"class_list":["post-86580","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-9099","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Linux\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\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\/86580.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\u73af\u5883\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 1.\u547d\u4ee4\u884c\u53c2\u6570 2. \u73af\u5883\u53d8\u91cf 2.1 \u6982\u5ff5 2.2 Linux\u4e2d\u7684\u73af\u5883\u53d8\u91cf 2.2.1 \u5e38\u89c1\u73af\u5883\u53d8\u91cf 2.2.2\u00a0\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5 \u200b 3.\u7406\u89e3\u73af\u5883\u53d8\u91cf\u7684\u4ea7\u751f 1.\u547d\u4ee4\u884c\u53c2\u6570 \u76f4\u63a5\u4e0a\u4ee3\u7801\u6f14\u793a&#xff1a; 1 #include2 3 int main(int argc,char* argv[]) \/\/int main(int argc, char **argv) \u6307\u9488\u5f62\u5f0f&#xff0c;\u5b8c\u5168\u7b49\u4ef74 {5   printf(&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/86580.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-28T14:16:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141635-6a68b9c306ad0.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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86580.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/86580.html\",\"name\":\"\u3010Linux\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\u73af\u5883\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-28T14:16:38+00:00\",\"dateModified\":\"2026-07-28T14:16:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/86580.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/86580.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86580.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\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\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\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\/86580.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\u73af\u5883\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 1.\u547d\u4ee4\u884c\u53c2\u6570 2. \u73af\u5883\u53d8\u91cf 2.1 \u6982\u5ff5 2.2 Linux\u4e2d\u7684\u73af\u5883\u53d8\u91cf 2.2.1 \u5e38\u89c1\u73af\u5883\u53d8\u91cf 2.2.2\u00a0\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5 \u200b 3.\u7406\u89e3\u73af\u5883\u53d8\u91cf\u7684\u4ea7\u751f 1.\u547d\u4ee4\u884c\u53c2\u6570 \u76f4\u63a5\u4e0a\u4ee3\u7801\u6f14\u793a&#xff1a; 1 #include2 3 int main(int argc,char* argv[]) \/\/int main(int argc, char **argv) \u6307\u9488\u5f62\u5f0f&#xff0c;\u5b8c\u5168\u7b49\u4ef74 {5   printf(\"","og_url":"https:\/\/www.wsisp.com\/helps\/86580.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-28T14:16:38+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728141635-6a68b9c306ad0.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/86580.html","url":"https:\/\/www.wsisp.com\/helps\/86580.html","name":"\u3010Linux\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\u73af\u5883\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-28T14:16:38+00:00","dateModified":"2026-07-28T14:16:38+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/86580.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/86580.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/86580.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux\u7cfb\u7edf\u7f16\u7a0b\u3011\u547d\u4ee4\u884c\u53c2\u6570\u548c\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\/86580","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=86580"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86580\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/86572"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=86580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=86580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=86580"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=86580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}