{"id":105793,"date":"2026-09-16T06:56:33","date_gmt":"2026-09-15T22:56:33","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/105793.html"},"modified":"2026-09-16T06:56:33","modified_gmt":"2026-09-15T22:56:33","slug":"%e3%80%90linux%e3%80%91%e4%b8%89%e5%8d%81%e5%85%ad-linux-%e6%96%87%e4%bb%b6%e4%b8%8e%e7%9b%ae%e5%bd%95%e6%93%8d%e4%bd%9c%e7%bb%88%e6%9e%81%e6%8c%87%e5%8d%97%ef%bc%9a%e4%bb%8e%e6%96%b0%e6%89%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/105793.html","title":{"rendered":"\u3010Linux\u3011\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4"},"content":{"rendered":"<p id=\"linux-\u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4\">\u73af\u5883&#xff1a;Ubuntu 22.04 &#043; g&#043;&#043;&#xff08;\u6587\u4e2d\u6240\u6709\u8f93\u51fa\u5747\u6765\u81ea\u6211\u7684\u771f\u5b9e\u7ec8\u7aef&#xff0c;\u975e\u7f16\u9020&#xff09; \u9002\u5408\u8c01&#xff1a;\u5728 IDE \u91cc\u70b9\u60ef\u4e86\u9f20\u6807\u3001\u4e00\u8fdb\u7ec8\u7aef\u5c31\u53d1\u61f5\u7684 C&#043;&#043; \u521d\u5b66\u8005 \u9605\u8bfb\u65b9\u5f0f&#xff1a;\u5efa\u8bae\u6536\u85cf\u3002\u547d\u4ee4\u4e0d\u7528\u80cc&#xff0c;\u7528\u5230\u65f6\u7ffb\u56de\u6765\u6284\u4e00\u904d&#xff0c;\u6284\u5341\u6b21\u5c31\u662f\u81ea\u5df1\u7684\u4e86<\/p>\n<p>\u5728 Linux \u4e0b\u505a C&#043;&#043; \u5f00\u53d1&#xff0c;\u8131\u79bb\u4e0d\u4e86\u4e0e\u6587\u4ef6\u548c\u76ee\u5f55\u6253\u4ea4\u9053\u3002\u5f88\u591a\u521d\u5b66\u8005\u5728 Windows \u7684 IDE \u91cc\u70b9\u9f20\u6807\u4e60\u60ef\u4e86&#xff0c;\u4e00\u8fdb\u9ed1\u4e4e\u4e4e\u7684\u7ec8\u7aef\u5c31\u53d1\u61f5&#xff0c;\u9047\u5230 mv\u3001cp\u3001rm \u603b\u662f\u5fc3\u60ca\u80c6\u6218&#xff0c;\u6015\u4e00\u4e0d\u5c0f\u5fc3\u5c31\u628a\u51e0\u5929\u7684\u4ee3\u7801\u5220\u6ca1\u4e86\u3002<\/p>\n<p>\u8fd9\u79cd\u62c5\u5fc3\u975e\u5e38\u5408\u7406\u2014\u2014Linux \u6ca1\u6709&#034;\u56de\u6536\u7ad9&#034;\u8fd9\u4e2a\u515c\u5e95&#xff08;\u684c\u9762\u7248\u6709&#xff0c;\u4f46\u670d\u52a1\u5668\u4e0a\u6ca1\u6709&#xff09;&#xff0c;\u5220\u4e86\u5c31\u662f\u5220\u4e86\u3002\u6240\u4ee5\u8fd9\u7bc7\u6307\u5357\u7684\u539f\u5219\u662f&#xff1a;\u6bcf\u6761\u547d\u4ee4\u90fd\u544a\u8bc9\u4f60\u5b83\u52a8\u7684\u662f\u4ec0\u4e48\u3001\u6700\u574f\u4f1a\u53d1\u751f\u4ec0\u4e48\u3001\u4ee5\u53ca\u52a8\u624b\u524d\u600e\u4e48\u5148\u770b\u4e00\u773c\u3002<\/p>\n<p>\u5185\u5bb9\u8986\u76d6\u76ee\u5f55\u5207\u6362\u3001\u589e\u5220\u6539\u67e5\u3001\u5185\u5bb9\u67e5\u770b\u3001\u7f16\u8bd1\u8fd0\u884c\u3001\u6743\u9650\u7ba1\u7406\u7684\u5168\u8fc7\u7a0b&#xff0c;\u6700\u540e\u7528&#034;\u628a lesson52 \u642c\u5bb6\u5230 lesson53&#034;\u8fd9\u4e2a\u771f\u5b9e\u6848\u4f8b\u505a\u4e00\u6b21\u5b9e\u6218\u590d\u76d8\u3002<\/p>\n<hr \/>\n<h3 id=\"\u4e00\u3001\u57fa\u7840\u4e2d\u7684\u57fa\u7840\uff1a\u4f60\u5728\u54ea\uff1f\u8fd9\u91cc\u6709\u4ec0\u4e48\uff1f\">\u4e00\u3001\u57fa\u7840\u4e2d\u7684\u57fa\u7840&#xff1a;\u4f60\u5728\u54ea&#xff1f;\u8fd9\u91cc\u6709\u4ec0\u4e48&#xff1f;<\/h3>\n<p>\u64cd\u4f5c\u6587\u4ef6\u4e4b\u524d&#xff0c;\u5148\u641e\u6e05\u695a\u4e24\u4ef6\u4e8b&#xff1a;\u6211\u5728\u54ea&#xff0c;\u8fd9\u513f\u6709\u4ec0\u4e48\u300290% \u7684&#034;\u6587\u4ef6\u64cd\u4f5c\u4e8b\u6545&#034;\u90fd\u6e90\u4e8e\u8fd9\u4e24\u4ef6\u4e8b\u6ca1\u641e\u6e05\u695a\u5c31\u52a8\u624b\u4e86\u3002<\/p>\n<h4 id=\"1.1-pwd\uff1a\u6211\u8fd9\u662f\u5728\u51e0\u697c\uff1f\">1.1 pwd&#xff1a;\u6211\u8fd9\u662f\u5728\u51e0\u697c&#xff1f;<\/h4>\n<p>pwd<br \/>\n# \u8f93\u51fa&#xff1a;\/home\/ubuntu\/code\/lesson53<\/p>\n<p>pwd \u662f Print Working Directory&#xff08;\u6253\u5370\u5de5\u4f5c\u76ee\u5f55&#xff09;\u7684\u7f29\u5199\u3002\u5b83\u544a\u8bc9\u4f60\u5f53\u524d&#034;\u7ad9&#034;\u5728\u6587\u4ef6\u7cfb\u7edf\u7684\u54ea\u4e2a\u4f4d\u7f6e\u3002Linux \u7684\u76ee\u5f55\u7ed3\u6784\u662f\u4e00\u68f5\u4ece \/&#xff08;\u6839\u76ee\u5f55&#xff09;\u957f\u51fa\u6765\u7684\u6811&#xff0c;pwd \u663e\u793a\u7684\u5c31\u662f\u4f60\u4ece\u6811\u6839\u8d70\u5230\u73b0\u5728\u7684\u5b8c\u6574\u8def\u5f84&#xff0c;\u4e5f\u53eb\u7edd\u5bf9\u8def\u5f84\u3002<\/p>\n<p>\u4e00\u4e2a\u771f\u5b9e\u573a\u666f&#xff1a;\u540c\u65f6\u5f00\u4e86\u4e09\u4e2a\u7ec8\u7aef&#xff0c;\u4e00\u4e2a\u5728\u7f16\u8bd1&#xff0c;\u4e00\u4e2a\u5728\u770b\u65e5\u5fd7&#xff0c;\u4e00\u4e2a\u5728\u6539\u4ee3\u7801\u3002\u6539\u4ee3\u7801\u524d\u5148\u6572\u4e00\u4e0b pwd&#xff0c;\u786e\u8ba4\u81ea\u5df1\u6ca1\u7ad9\u9519\u697c\u2014\u2014\u8fd9\u662f\u6bd4\u4efb\u4f55&#034;\u64a4\u9500\u952e&#034;\u90fd\u53ef\u9760\u7684\u4fdd\u547d\u4e60\u60ef\u3002<\/p>\n<hr \/>\n<h4 id=\"1.2-ls\uff1a\u8fd9\u5c42\u697c\u90fd\u6709\u4ec0\u4e48\u623f\u95f4\uff1f\">1.2 ls&#xff1a;\u8fd9\u5c42\u697c\u90fd\u6709\u4ec0\u4e48\u623f\u95f4&#xff1f;<\/h4>\n<p>ls<br \/>\n# \u8f93\u51fa&#xff1a;Dict.hpp  InetAddr.hpp  Log.hpp  Makefile  Mutex.hpp<br \/>\n#       UdpClient.cc  UdpServer.cc  UdpServer.hpp  dictionary.txt<\/p>\n<p>ls \u662f List \u7684\u7f29\u5199&#xff0c;\u5217\u51fa\u76ee\u5f55\u5185\u5bb9\u3002\u4f46\u5b83\u6709\u51e0\u4f4d\u5e38\u9a7b&#034;\u642d\u6863&#034;&#xff0c;\u5404\u6709\u5404\u7684\u7528\u5904&#xff1a;<\/p>\n<p>ls -l&#xff1a;\u770b\u8be6\u60c5&#xff08;long format&#xff09;<\/p>\n<p>ls -l<br \/>\ntotal 232<br \/>\n-rw-rw-r&#8211; 1 ubuntu ubuntu   1989 Sep 13 17:22 Dict.hpp<br \/>\n-rwxrwxr-x 1 ubuntu ubuntu 130105 Sep 13 17:23 udpserver<\/p>\n<p>\u4ee5 udpserver \u8fd9\u884c\u4e3a\u4f8b&#xff0c;\u62c6\u5f00\u770b&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\n<p>\u7247\u6bb5<\/p>\n<p>\u542b\u4e49<\/p>\n<\/tr>\n<tr>\n<td>\n<p>-rwxrwxr-x<\/p>\n<\/td>\n<td>\n<p>\u6743\u9650&#xff1a;\u7b2c\u4e00\u4e2a &#8211; \u662f\u666e\u901a\u6587\u4ef6&#xff08;\u76ee\u5f55\u662f d&#xff09;&#xff0c;\u540e\u9762 9 \u4e2a\u5b57\u7b26\u6bcf 3 \u4e2a\u4e00\u7ec4&#xff0c;\u5206\u522b\u662f\u6240\u6709\u8005 \/ \u540c\u7ec4\u7528\u6237 \/ \u5176\u4ed6\u4eba\u7684 r\u8bfb w\u5199 x\u6267\u884c \u6743\u9650<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>\u786c\u94fe\u63a5\u6570&#xff08;\u6307\u5411\u8fd9\u4e2a\u6587\u4ef6\u7684\u540d\u5b57\u6570\u91cf&#xff09;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ubuntu ubuntu<\/p>\n<\/td>\n<td>\n<p>\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>130105<\/p>\n<\/td>\n<td>\n<p>\u5b57\u8282\u6570<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Sep 13 17:23<\/p>\n<\/td>\n<td>\n<p>\u6700\u540e\u4fee\u6539\u65f6\u95f4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>udpserver<\/p>\n<\/td>\n<td>\n<p>\u6587\u4ef6\u540d<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6ce8\u610f udpserver \u662f -rwxrwxr-x\u2014\u2014\u6709 x&#xff08;\u53ef\u6267\u884c\u4f4d&#xff09;&#xff0c;\u6240\u4ee5\u5b83\u80fd\u76f4\u63a5\u8dd1&#xff1b;\u800c Dict.hpp \u662f -rw-rw-r&#8211;&#xff0c;\u6ca1\u6709 x&#xff0c;\u5b83\u5c31\u662f\u4e2a\u6587\u672c\u6587\u4ef6&#xff0c;\u4e0d\u5b58\u5728&#034;\u8fd0\u884c&#034;\u4e00\u8bf4\u3002\u8fd9\u4e2a x \u5c31\u662f\u5927\u540d\u9f0e\u9f0e\u7684&#034;\u53ef\u6267\u884c\u6743\u9650&#034;&#xff0c;\u7b2c\u4e03\u8282\u4f1a\u8bb2\u600e\u4e48\u52a0\u3002<\/p>\n<hr \/>\n<p>ls -a&#xff1a;\u8fde\u9690\u85cf\u6587\u4ef6\u4e00\u8d77\u770b&#xff08;all&#xff09;<\/p>\n<p>Linux \u91cc\u4ee5 . \u5f00\u5934\u7684\u6587\u4ef6\u9ed8\u8ba4\u4e0d\u663e\u793a&#xff0c;\u6bd4\u5982 Git \u4ed3\u5e93\u7684 .git\u3001bash \u7684\u914d\u7f6e .bashrc\u3002\u60f3\u770b\u5168\u5c31\u5f97\u52a0 -a&#xff1a;<\/p>\n<p>ls -a<br \/>\n# .  ..  .git  Dict.hpp  Makefile &#8230;<\/p>\n<p>\u8fd9\u91cc\u6df7\u8fdb\u4e86\u4e24\u4e2a\u5947\u602a\u7684&#034;\u6587\u4ef6&#034;&#xff1a;. \u548c ..\u3002\u5b83\u4eec\u4e0d\u662f\u6587\u4ef6&#xff0c;\u662f\u4e24\u4e2a\u7279\u6b8a\u7684\u76ee\u5f55\u5165\u53e3\u2014\u2014. \u4ee3\u8868&#034;\u5f53\u524d\u76ee\u5f55&#034;&#xff0c;.. \u4ee3\u8868&#034;\u4e0a\u4e00\u7ea7\u76ee\u5f55&#034;\u3002\u8bb0\u4f4f\u8fd9\u4e00\u5bf9&#xff0c;\u4e0b\u9762\u7684 cd .. \u548c mv ..\/xx \u5c31\u90fd\u901a\u4e86\u3002<\/p>\n<p>\u987a\u5e26\u8bf4\u4e00\u4e2a\u7ecf\u5178\u56f0\u60d1&#xff1a;\u4e3a\u4ec0\u4e48 ls -a \u91cc .git \u80fd\u770b\u5230&#xff0c;\u4f46 ls \u770b\u4e0d\u5230&#xff1f;\u5c31\u662f\u56e0\u4e3a&#034;\u70b9\u5f00\u5934 &#061; \u9690\u85cf&#034;\u8fd9\u6761\u89c4\u77e9\u3002\u4ee5\u540e\u627e\u4e0d\u5230 .gitignore\u3001.vscode \u6587\u4ef6\u5939\u65f6&#xff0c;\u7b2c\u4e00\u53cd\u5e94\u5e94\u8be5\u662f&#034;\u6211\u5fd8\u4e86\u52a0 -a&#034;\u3002<\/p>\n<hr \/>\n<p>ls -lh&#xff1a;\u4eba\u8bdd\u7248\u6587\u4ef6\u5927\u5c0f&#xff08;human-readable&#xff09;<\/p>\n<p>-l \u663e\u793a\u7684 130105 \u5b57\u8282\u5bf9\u4eba\u4e0d\u53cb\u597d&#xff0c;\u52a0\u4e0a -h&#xff1a;<\/p>\n<p>ls -lh<br \/>\n-rw-rw-r&#8211; 1 ubuntu ubuntu 2.0K Sep 13 17:22 Dict.hpp<br \/>\n-rwxrwxr-x 1 ubuntu ubuntu 127K Sep 13 17:23 udpserver<\/p>\n<p>127K \u4e00\u773c\u5c31\u61c2\u3002\u6392\u67e5&#034;\u65e5\u5fd7\u6587\u4ef6\u600e\u4e48\u628a\u78c1\u76d8\u5403\u6ee1\u4e86&#034;\u8fd9\u79cd\u95ee\u9898\u65f6&#xff0c;ls -lh \u914d\u5408 du -sh *&#xff08;\u770b\u6bcf\u4e2a\u76ee\u5f55\u5360\u591a\u5927&#xff09;\u662f\u6807\u914d\u7ec4\u5408\u3002<\/p>\n<p>ls -lt&#xff1a;\u6309\u4fee\u6539\u65f6\u95f4\u6392\u5e8f&#xff0c;\u6700\u65b0\u6539\u7684\u6392\u6700\u524d\u3002\u627e&#034;\u6211\u521a\u624d\u5230\u5e95\u6539\u4e86\u54ea\u4e2a\u6587\u4ef6&#034;\u7279\u522b\u597d\u7528\u3002-l \u7cfb\u5217\u7684\u53c2\u6570\u53ef\u4ee5\u76f4\u63a5\u53e0&#xff1a;ls -lht\u3001ls -lha \u90fd\u5408\u6cd5\u3002<\/p>\n<hr \/>\n<h3 id=\"\u4e8c\u3001\u7a7f\u68ad\u4e8e\u76ee\u5f55\u4e4b\u95f4\uff1acd-\u4e0e\u8def\u5f84\">\u4e8c\u3001\u7a7f\u68ad\u4e8e\u76ee\u5f55\u4e4b\u95f4&#xff1a;cd \u4e0e\u8def\u5f84<\/h3>\n<h4 id=\"2.1-cd-\u7684\u56db\u79cd\u5e38\u7528\u59ff\u52bf\">2.1 cd \u7684\u56db\u79cd\u5e38\u7528\u59ff\u52bf<\/h4>\n<p>cd lesson53      # \u8fdb\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u7684 lesson53&#xff08;\u76f8\u5bf9\u8def\u5f84&#xff09;<br \/>\ncd ..            # \u8fd4\u56de\u4e0a\u4e00\u7ea7<br \/>\ncd ~             # \u56de\u5230\u5bb6\u76ee\u5f55&#xff08;\/home\/ubuntu&#xff09;&#xff0c;\u5149\u6572 cd \u4e0d\u5e26\u53c2\u6570\u6548\u679c\u4e00\u6837<br \/>\ncd &#8211;             # \u8fd4\u56de\u4e0a\u4e00\u6b21\u6240\u5728\u7684\u76ee\u5f55<\/p>\n<p>cd &#8211; \u503c\u5f97\u591a\u8bf4\u4e00\u53e5&#xff1a;\u5b83\u50cf&#034;\u4e0a\u4e00\u66f2&#034;\u6309\u94ae&#xff0c;\u5728\u4e24\u4e2a\u76ee\u5f55\u4e4b\u95f4\u53cd\u590d\u6a2a\u8df3\u65f6\u662f\u795e\u5668\u3002\u6bd4\u5982\u4f60\u5728 \/home\/ubuntu\/code \u7f16\u8bd1&#xff0c;\u7a81\u7136\u8981\u53bb \/var\/log \u770b\u65e5\u5fd7&#xff0c;\u770b\u5b8c\u4e00\u4e2a cd &#8211; \u5c31\u56de\u6765\u4e86&#xff0c;\u4e0d\u7528\u628a\u957f\u8def\u5f84\u518d\u6572\u4e00\u904d\u3002<\/p>\n<hr \/>\n<h4 id=\"2.2-\u7edd\u5bf9\u8def\u5f84-vs-\u76f8\u5bf9\u8def\u5f84\">2.2 \u7edd\u5bf9\u8def\u5f84 vs \u76f8\u5bf9\u8def\u5f84<\/h4>\n<p>\u8fd9\u662f\u65b0\u624b\u6700\u5bb9\u6613\u7ed5\u6655\u3001\u4f46\u5fc5\u987b\u5f7b\u5e95\u641e\u61c2\u7684\u6982\u5ff5\u3002<\/p>\n<ul>\n<li>\n<p>\u7edd\u5bf9\u8def\u5f84&#xff1a;\u4ee5 \/ \u5f00\u5934&#xff0c;\u4ece\u6839\u76ee\u5f55\u5f00\u59cb\u5199\u5b8c\u6574\u3002\u6bd4\u5982 \/home\/ubuntu\/code\/lesson53\u3002\u5b83\u50cf&#034;\u5317\u4eac\u5e02\u6d77\u6dc0\u533axx\u8defxx\u53f7&#034;&#xff0c;\u5168\u4e16\u754c\u4efb\u4f55\u5730\u65b9\u5bc4\u4fe1\u90fd\u80fd\u9001\u8fbe&#xff0c;\u4e0d\u4f9d\u8d56\u4f60\u73b0\u5728\u7684\u4f4d\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>\u76f8\u5bf9\u8def\u5f84&#xff1a;\u4ee5\u5f53\u524d\u76ee\u5f55\u4e3a\u53c2\u7167\u3002\u6bd4\u5982 cd lesson53\u3001cd ..\/lesson52\u3002\u5b83\u50cf&#034;\u9694\u58c1\u90a3\u680b\u697c&#034;&#xff0c;\u79bb\u5f00\u4e86\u8fd9\u4e2a\u8857\u533a\u5c31\u6ca1\u6cd5\u8fd9\u4e48\u8bf4\u4e86\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u7528\u7b26\u53f7\u62c6\u89e3\u4e00\u4e0b&#xff1a;<\/p>\n<p>\/home\/ubuntu\/code\/lesson53<br \/>\n\u2514\u2500\u252c\u2500\u2518\u2514\u2500\u2500\u252c\u2500\u2500\u2518\u2514\u2500\u252c\u2500\u2518\u2514\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2518<br \/>\n  \/   \u5bb6\u76ee\u5f55   code   lesson53<\/p>\n<p>\u51e0\u4e2a\u7ec4\u5408\u62f3&#xff1a;<\/p>\n<p>cd ..            # \u4e0a\u4e00\u7ea7<br \/>\ncd ..\/..         # \u4e0a\u4e24\u7ea7<br \/>\ncd ..\/lesson52   # \u4e0a\u4e00\u7ea7\u91cc\u7684 lesson52&#xff08;\u5148\u51fa\u95e8&#xff0c;\u518d\u8fdb\u9694\u58c1&#xff09;<br \/>\ncd ~\/code        # \u5bb6\u76ee\u5f55\u4e0b\u7684 code&#xff08;~ \u662f\u5bb6\u76ee\u5f55\u7684\u7f29\u5199&#xff0c;\u7b49\u4e8e\u7edd\u5bf9\u8def\u5f84\u7684\u7b80\u5199&#xff09;<\/p>\n<p>Tab \u952e\u662f cd \u7684\u6700\u4f73\u62cd\u6863\u3002\u8f93\u5165 cd les \u7136\u540e\u6309 Tab&#xff0c;bash \u4f1a\u81ea\u52a8\u8865\u5168\u6210 cd lesson53&#xff1b;\u6709\u591a\u4e2a\u5019\u9009\u65f6\u6309\u4e24\u6b21 Tab \u4f1a\u5217\u51fa\u6240\u6709\u53ef\u80fd\u3002\u8def\u5f84\u518d\u957f\u4e5f\u6572\u4e09\u56db\u4e2a\u5b57\u6bcd\u52a0\u4e00\u4e2a Tab&#xff0c;\u8fd9\u65e2\u662f\u63d0\u901f&#xff0c;\u66f4\u662f\u9632\u9519\u2014\u2014\u624b\u6572\u7684\u957f\u8def\u5f84\u62fc\u9519\u4e00\u4e2a\u5b57\u6bcd\u5c31\u662f No such file or directory\u3002<\/p>\n<hr \/>\n<h4 id=\"2.3-\u4e00\u4e2a\u503c\u5f97\u8bb0\u4f4f\u7684\u5fc3\u7406\u6a21\u578b\">2.3 \u4e00\u4e2a\u503c\u5f97\u8bb0\u4f4f\u7684\u5fc3\u7406\u6a21\u578b<\/h4>\n<p>\u628a\u76ee\u5f55\u60f3\u8c61\u6210\u697c\u5c42&#xff0c;\u628a cd \u60f3\u8c61\u6210\u8d70\u8def&#xff1a;<\/p>\n<ul>\n<li>\n<p>pwd \u662f\u95ee&#034;\u6211\u5728\u51e0\u697c&#034;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>ls \u662f\u770b&#034;\u8fd9\u5c42\u6709\u54ea\u4e9b\u623f\u95f4&#034;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>cd \u662f&#034;\u8d70\u5230\u67d0\u4e2a\u623f\u95f4&#034;\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u6240\u6709\u6587\u4ef6\u64cd\u4f5c&#xff08;rm\u3001mv\u3001cp&#xff09;\u90fd\u662f\u5728&#034;\u4f60\u5f53\u524d\u7ad9\u7acb\u7684\u697c\u5c42&#034;\u53d1\u751f\u7684\u3002\u8d70\u9519\u697c\u5c42\u518d\u52a8\u624b&#xff0c;\u662f\u4e8b\u6545\u7684\u7b2c\u4e00\u5927\u6765\u6e90\u3002 \u6240\u4ee5\u517b\u6210\u808c\u8089\u8bb0\u5fc6&#xff1a;pwd \u2192 ls \u786e\u8ba4 \u2192 \u518d\u52a8\u624b\u3002<\/p>\n<hr \/>\n<h3 id=\"\u4e09\u3001\u521b\u5efa\u4e0e\u5220\u9664\uff1a\u5c0f\u5fc3\u9a76\u5f97\u4e07\u5e74\u8239\">\u4e09\u3001\u521b\u5efa\u4e0e\u5220\u9664&#xff1a;\u5c0f\u5fc3\u9a76\u5f97\u4e07\u5e74\u8239<\/h3>\n<p>\u8fd9\u662f\u6700\u5bb9\u6613\u51fa\u4e8b\u6545\u7684\u91cd\u707e\u533a&#xff0c;\u6bcf\u6761\u547d\u4ee4\u6211\u90fd\u4f1a\u6807\u4e0a\u5371\u9669\u7b49\u7ea7\u3002<\/p>\n<h4 id=\"3.1-\u521b\u5efa\uff08\u5371\u9669\u7b49\u7ea7\uff1a\u2605\uff09\">3.1 \u521b\u5efa<\/h4>\n<p>touch \u6587\u4ef6\u540d&#xff1a;\u521b\u5efa\u7a7a\u6587\u4ef6<\/p>\n<p>touch test.cpp        # \u521b\u5efa\u4e00\u4e2a 0 \u5b57\u8282\u7684\u7a7a\u6e90\u6587\u4ef6<\/p>\n<p>\u5982\u679c\u6587\u4ef6\u5df2\u5b58\u5728&#xff0c;touch \u4e0d\u4f1a\u6e05\u7a7a\u5b83&#xff0c;\u53ea\u66f4\u65b0&#034;\u6700\u540e\u4fee\u6539\u65f6\u95f4&#034;\u3002\u6240\u4ee5 touch \u662f\u4e2a\u5b89\u5168\u547d\u4ee4&#xff0c;\u653e\u5fc3\u7528\u3002<\/p>\n<p>mkdir \u76ee\u5f55\u540d&#xff1a;\u521b\u5efa\u76ee\u5f55<\/p>\n<p>mkdir build           # \u521b\u5efa\u4e00\u4e2a\u53eb build \u7684\u76ee\u5f55&#xff08;\u7f16\u8bd1\u4ea7\u7269\u5e38\u653e\u8fd9\u91cc&#xff09;<\/p>\n<p>mkdir -p a\/b\/c&#xff1a;\u9012\u5f52\u521b\u5efa\u591a\u7ea7\u76ee\u5f55<\/p>\n<p>\u7236\u76ee\u5f55\u4e0d\u5b58\u5728\u4e5f\u6ca1\u5173\u7cfb&#xff0c;\u4e00\u8def\u81ea\u52a8\u5efa\u597d\u3002\u521d\u59cb\u5316\u9879\u76ee\u7ed3\u6784\u65f6\u975e\u5e38\u597d\u7528&#xff1a;<\/p>\n<p>mkdir -p myproject\/{src,include,build}   # \u4e00\u6761\u547d\u4ee4\u5efa\u51fa\u4e09\u4e2a\u5b50\u76ee\u5f55<\/p>\n<p>\u82b1\u62ec\u53f7\u5c55\u5f00 {a,b,c} \u662f bash \u63d0\u4f9b\u7684\u8bed\u6cd5\u7cd6&#xff0c;\u4e00\u6761\u547d\u4ee4\u9876\u4e09\u6761\u3002<\/p>\n<hr \/>\n<h4 id=\"3.2-\u5220\u9664\uff08\u5371\u9669\u7b49\u7ea7\uff1a\u2605\u2605\u2605\uff0c\u5168\u6587\u6700\u5371\u9669\u7684\u6bb5\u843d\uff09\">3.2 \u5220\u9664<\/h4>\n<p>rm \u6587\u4ef6\u540d      # \u5220\u9664\u6587\u4ef6&#xff0c;\u5220\u9664\u540e\u65e0\u6cd5\u627e\u56de&#xff0c;Linux \u6ca1\u6709\u56de\u6536\u7ad9<br \/>\nrm -r \u76ee\u5f55\u540d   # \u9012\u5f52\u5220\u9664\u76ee\u5f55\u53ca\u5176\u5185\u90e8\u6240\u6709\u5185\u5bb9&#xff08;r &#061; recursive&#xff09;<br \/>\nrm -rf \u76ee\u5f55\u540d  # \u9012\u5f52 &#043; \u5f3a\u5236&#xff1a;\u4e0d\u63d0\u793a\u3001\u4e0d\u786e\u8ba4\u3001\u62a5\u9519\u4e5f\u4e0d\u505c&#xff0c;\u76f4\u63a5\u5220\u5149<\/p>\n<p>\u5371\u9669\u7b49\u7ea7\u9010\u6761\u770b&#xff1a;<\/p>\n<ul>\n<li>\n<p>rm test.cpp&#xff1a;\u5220\u5355\u4e2a\u6587\u4ef6\u3002\u65b0\u624b\u7684\u56f0\u60d1\u901a\u5e38\u662f&#034;\u5b83\u600e\u4e48\u4e0d\u95ee\u6211\u4e00\u58f0\u5c31\u5220\u4e86&#034;\u2014\u2014\u5bf9&#xff0c;Linux \u7684\u54f2\u5b66\u5c31\u662f&#034;\u4f60\u8ba9\u5b83\u505a\u5b83\u5c31\u505a&#034;&#xff0c;\u6c89\u9ed8\u5730\u6267\u884c\u5c31\u662f\u6210\u529f\u3002\u771f\u60f3\u6bcf\u6b21\u90fd\u786e\u8ba4&#xff0c;\u7528 rm -i \u6587\u4ef6\u540d\u3002<\/p>\n<\/li>\n<li>\n<p>rm -r build&#xff1a;\u5220\u6574\u4e2a\u76ee\u5f55\u3002-r \u662f\u5fc5\u987b\u7684&#xff0c;\u4e0d\u5e26\u5b83\u5220\u76ee\u5f55\u4f1a\u62a5\u9519 cannot remove &#039;build&#039;: Is a directory\u2014\u2014\u8fd9\u4e2a\u62a5\u9519\u5176\u5b9e\u662f\u5728\u4fdd\u62a4\u4f60\u3002<\/p>\n<\/li>\n<li>\n<p>rm -rf&#xff1a;Linux \u516c\u8ba4\u6700\u5371\u9669\u7684\u4e00\u6761\u547d\u4ee4\u3002-f&#xff08;force&#xff09;\u628a\u6700\u540e\u4e24\u9053\u4fdd\u9669\u90fd\u62c6\u4e86&#xff1a;\u4e0d\u63d0\u793a&#xff0c;\u751a\u81f3\u4f60\u6253\u9519\u5b57\u5b83\u4e5f\u4e0d\u558a\u505c\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8840\u7684\u6559\u8bad\u7ea7\u522b\u8b66\u544a&#xff1a;\u5343\u4e07\u4e0d\u8981\u5728\u6839\u76ee\u5f55 \/ \u4e0b\u6267\u884c rm -rf *&#xff0c;\u4e5f\u522b\u624b\u6ed1\u628a\u53d8\u91cf\u6ca1\u8d4b\u503c\u5c31 rm -rf $dir\/ *\u2014\u2014$dir \u4e3a\u7a7a\u65f6\u5b83\u5c31\u53d8\u6210&#034;\u5220\u9664\u6839\u4e0b\u6240\u6709\u4e1c\u897f&#034;\u3002\u9664\u975e\u767e\u5206\u4e4b\u767e\u786e\u5b9a&#xff0c;\u5426\u5219\u4e0d\u8981\u52a0 -f\u3002<\/p>\n<p>\u4e09\u6761\u4fdd\u547d\u5efa\u8bae&#xff1a;<\/p>\n<li>\n<p>\u5220\u4e4b\u524d\u5148 ls \u770b\u4e00\u773c\u8981\u5220\u7684\u4e1c\u897f&#xff0c;\u786e\u8ba4\u76ee\u5f55\u91cc\u6ca1\u6709\u5b9d\u8d1d&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u5220\u4e4b\u524d pwd \u786e\u8ba4\u81ea\u5df1\u7ad9\u5728\u54ea&#xff0c;\u522b\u5728 \/ \u6216\u8005\u5bb6\u76ee\u5f55\u91cc\u5e72\u5927\u4e8b&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u5220\u76ee\u5f55\u65f6&#xff0c;\u5148 rm -ri \u76ee\u5f55\u540d \u9010\u4e2a\u786e\u8ba4\u592a\u9ebb\u70e6\u7684\u8bdd&#xff0c;\u81f3\u5c11\u770b\u4e00\u773c ls \u76ee\u5f55\u540d \u7684\u5185\u5bb9\u518d\u4e0b\u5200\u3002<\/p>\n<\/li>\n<p>\u8865\u5145\u4e00\u4e2a\u6e29\u548c\u7684\u66ff\u4ee3\u54c1&#xff1a;rmdir \u76ee\u5f55\u540d \u53ea\u80fd\u5220\u7a7a\u76ee\u5f55&#xff0c;\u76ee\u5f55\u91cc\u6709\u4e1c\u897f\u5b83\u4f1a\u62d2\u7edd\u3002\u5f53\u4f60\u53ea\u60f3\u6e05\u7406\u7a7a\u76ee\u5f55\u65f6&#xff0c;\u7528\u5b83\u6bd4 rm -r \u5b89\u5168\u5f97\u591a\u3002<\/p>\n<hr \/>\n<h3 id=\"\u56db\u3001\u79fb\u52a8\u3001\u91cd\u547d\u540d\u4e0e\u590d\u5236\uff1a\u642c\u8fd0\u7684\u827a\u672f\">\u56db\u3001\u79fb\u52a8\u3001\u91cd\u547d\u540d\u4e0e\u590d\u5236&#xff1a;\u642c\u8fd0\u7684\u827a\u672f<\/h3>\n<p>\u8fd9\u4e00\u8282\u5bf9\u5e94\u7684\u6b63\u662f\u6211\u6700\u8fd1\u771f\u5b9e\u7ffb\u8f66\u53c8\u6551\u56de\u6765\u7684\u573a\u666f&#xff0c;\u5148\u8bb2\u547d\u4ee4&#xff0c;\u7b2c\u516b\u8282\u590d\u76d8\u5b8c\u6574\u6848\u4f8b\u3002<\/p>\n<h4 id=\"4.1-mv\uff1a\u65e2\u662f&quot;\u526a\u5207&quot;\u4e5f\u662f&quot;\u6539\u540d&quot;\uff08\u5371\u9669\u7b49\u7ea7\uff1a\u2605\u2605\uff09\">4.1 mv&#xff1a;\u65e2\u662f&#034;\u526a\u5207&#034;\u4e5f\u662f&#034;\u6539\u540d&#034;<\/h4>\n<p>mv&#xff08;move&#xff09;\u4e00\u8eab\u517c\u4e24\u804c&#xff0c;\u53d6\u51b3\u4e8e\u76ee\u6807\u662f\u4ec0\u4e48&#xff1a;<\/p>\n<p># \u7528\u6cd5\u4e00&#xff1a;\u79fb\u52a8\u6587\u4ef6\u5230\u522b\u7684\u76ee\u5f55<br \/>\nmv a.cpp ..\/            # \u628a a.cpp \u526a\u5207\u5230\u4e0a\u4e00\u7ea7\u76ee\u5f55<br \/>\nmv a.cpp build\/         # \u526a\u5207\u5230 build \u76ee\u5f55\u91cc&#xff08;\u6ce8\u610f\u7ed3\u5c3e\u7684 \/&#xff09;<\/p>\n<p># \u7528\u6cd5\u4e8c&#xff1a;\u91cd\u547d\u540d&#xff08;\u76ee\u6807\u8def\u5f84\u8fd8\u662f\u539f\u5730&#xff0c;\u53ea\u662f\u6362\u540d\u5b57&#xff09;<br \/>\nmv old.cpp new.cpp      # old.cpp \u6539\u540d\u4e3a new.cpp<br \/>\nmv lesson52 lesson53    # \u628a\u76ee\u5f55 lesson52 \u6574\u4f53\u6539\u540d\u4e3a lesson53<\/p>\n<p>\u7406\u89e3 mv \u7684\u884c\u4e3a\u903b\u8f91&#xff1a;&#034;\u76ee\u6807&#034;\u662f\u6587\u4ef6\u540d\u5c31\u662f\u6539\u540d&#xff0c;&#034;\u76ee\u6807&#034;\u662f\u5df2\u5b58\u5728\u7684\u76ee\u5f55\u5c31\u662f\u642c\u8fdb\u53bb\u3002<\/p>\n<p>\u7531\u6b64\u63a8\u51fa\u4e00\u4e2a\u9ad8\u9891\u5751&#xff1a;\u5982\u679c\u7b2c\u4e8c\u6761\u91cc\u4f60\u4e0d\u5c0f\u5fc3\u5199\u6210 mv a.cpp \u5b58\u5728\u7684\u76ee\u5f55&#xff0c;a.cpp \u4f1a\u8dd1\u8fdb\u76ee\u5f55\u91cc&#xff1b;\u4f46\u5982\u679c\u76ee\u5f55\u540d\u62fc\u9519\u4e86\u4e00\u4e2a\u5b57\u6bcd&#xff08;\u76ee\u6807\u4e0d\u5b58\u5728&#xff09;&#xff0c;mv \u4e0d\u4f1a\u62a5\u9519&#xff0c;\u800c\u662f\u628a a.cpp \u6539\u540d\u6210\u90a3\u4e2a\u62fc\u9519\u7684\u540d\u5b57\u3002\u6587\u4ef6\u6ca1\u4e22&#xff0c;\u4f46&#034;\u6d88\u5931&#034;\u4e86\u2014\u2014\u53bb ls \u627e\u627e\u90a3\u4e2a\u62fc\u9519\u7684\u540d\u5b57\u5427\u3002<\/p>\n<p>\u53e6\u4e00\u4e2a\u5751&#xff1a;mv a.cpp dir \u548c mv a.cpp dir\/ \u6548\u679c\u4e00\u6837\u5417&#xff1f;\u5f53 dir \u5b58\u5728\u65f6\u4e00\u6837&#xff1b;\u5f53 dir \u4e0d\u5b58\u5728\u65f6&#xff0c;\u524d\u8005\u628a a.cpp \u6539\u540d\u4e3a dir&#xff0c;\u540e\u8005\u660e\u786e\u62a5\u9519\u3002\u6240\u4ee5\u79fb\u52a8\u5230\u76ee\u5f55\u65f6\u4e60\u60ef\u6027\u5e26\u4e0a\u7ed3\u5c3e\u7684 \/&#xff0c;\u80fd\u8ba9\u9519\u8bef\u65e9\u70b9\u66b4\u9732\u3002<\/p>\n<p>\u6279\u91cf\u642c\u8fd0&#xff1a;\u901a\u914d\u7b26 *<\/p>\n<p>mv ..\/lesson52\/* .     # \u628a\u4e0a\u4e00\u7ea7 lesson52 \u91cc\u7684\u6240\u6709\u5185\u5bb9&#xff0c;\u642c\u5230\u5f53\u524d\u76ee\u5f55<\/p>\n<p>* \u662f\u901a\u914d\u7b26&#xff0c;\u4ee3\u8868&#034;\u5f53\u524d\u5c42\u7684\u6240\u6709\u4e1c\u897f&#034;\u3002\u4e24\u4e2a\u7ec6\u8282&#xff1a;<\/p>\n<ul>\n<li>\n<p>* \u9ed8\u8ba4\u4e0d\u5305\u542b\u70b9\u5f00\u5934\u7684\u9690\u85cf\u6587\u4ef6\u3002mv dir\/* . \u642c\u5b8c\u4e4b\u540e&#xff0c;ls dir -a \u91cc\u5f80\u5f80\u8fd8\u8eba\u7740 .git\u3001.gitignore \u8fd9\u4e9b\u9690\u5f62\u4f4f\u6237\u3002\u60f3\u5168\u642c\u8d70&#xff1a;mv dir\/* dir\/.* .&#xff0c;\u6216\u8005\u5e72\u8106 mv dir\/* . &amp;&amp; mv dir\/.[!.]* .&#xff08;\u628a .git \u8fd9\u7c7b\u4e5f\u642c\u8d70&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u901a\u914d\u7b26\u662f bash \u5728\u547d\u4ee4\u6267\u884c\u524d\u5c55\u5f00\u7684&#xff0c;\u6240\u4ee5 rm dir\/* \u4f1a\u5148\u5c55\u5f00\u6210\u4e00\u5927\u4e32\u6587\u4ef6\u540d\u518d\u5220\u2014\u2014\u8fd9\u4e5f\u662f\u5b83\u5371\u9669\u7684\u539f\u56e0\u4e4b\u4e00&#xff0c;\u5c55\u5f00\u51fa\u6765\u4ec0\u4e48\u4f60\u4e8b\u5148\u770b\u4e0d\u6e05\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h4 id=\"4.2-cp\uff1a\u590d\u5236\uff0c\u539f\u4ef6\u8fd8\u5728\uff08\u5371\u9669\u7b49\u7ea7\uff1a\u2605\uff09\">4.2 cp&#xff1a;\u590d\u5236&#xff0c;\u539f\u4ef6\u8fd8\u5728<\/h4>\n<p>cp a.cpp b.cpp             # \u590d\u5236 a.cpp \u4e00\u4efd&#xff0c;\u547d\u540d\u4e3a b.cpp<br \/>\ncp a.cpp ..\/               # \u590d\u5236\u5230\u4e0a\u4e00\u7ea7&#xff08;\u540d\u5b57\u4e0d\u53d8&#xff09;<br \/>\ncp -r lesson52 lesson53    # \u9012\u5f52\u590d\u5236\u6574\u4e2a\u76ee\u5f55&#xff08;r \u540c\u6837\u662f recursive&#xff09;<\/p>\n<p>mv \u4e0e cp \u7684\u672c\u8d28\u533a\u522b&#xff1a;mv \u662f\u526a\u5207&#xff0c;\u539f\u4f4d\u7f6e\u6d88\u5931&#xff1b;cp \u662f\u590d\u5370&#xff0c;\u539f\u5730\u548c\u76ee\u6807\u5404\u4e00\u4efd\u3002\u62ff\u4e0d\u51c6\u7684\u65f6\u5019&#xff0c;\u7528 cp \u6c38\u8fdc\u6bd4 mv \u5b89\u5168\u2014\u2014\u5927\u4e0d\u4e86\u591a\u4e00\u4efd\u518d\u5220\u3002<\/p>\n<p>\u4e24\u4e2a\u8fdb\u9636\u53c2\u6570&#xff1a;<\/p>\n<ul>\n<li>\n<p>cp -i&#xff1a;\u76ee\u6807\u6587\u4ef6\u5df2\u5b58\u5728\u65f6\u5148\u95ee\u4f60\u8981\u4e0d\u8981\u8986\u76d6&#xff08;\u9632\u624b\u6ed1\u8986\u76d6\u6389\u522b\u4eba\u7684\u4ee3\u7801&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>cp -a&#xff1a;\u590d\u5236\u65f6\u8fde\u540c\u6743\u9650\u3001\u65f6\u95f4\u6233\u3001\u6240\u6709\u8005\u4e00\u8d77\u4fdd\u7559&#xff08;archive&#xff09;&#xff0c;\u5907\u4efd\u4ee3\u7801\u6216\u62f7\u8d1d\u914d\u7f6e\u6587\u4ef6\u65f6\u7528\u5b83&#xff0c;\u4e0d\u7136\u6587\u4ef6\u65f6\u95f4\u5168\u53d8\u6210&#034;\u73b0\u5728&#034;&#xff0c;\u4ee5\u540e\u6309\u65f6\u95f4\u6392\u67e5\u95ee\u9898\u4f1a\u4e00\u5934\u96fe\u6c34\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u6ce8\u610f&#xff1a;\u590d\u5236\u76ee\u5f55\u5fc5\u987b\u52a0 -r&#xff0c;\u4e0d\u52a0\u4f1a\u62a5\u9519 omitting directory &#039;lesson52&#039;\u2014\u2014cp \u9ed8\u8ba4\u53ea\u642c\u6587\u4ef6&#xff0c;\u9047\u5230\u76ee\u5f55\u76f4\u63a5\u8df3\u8fc7&#xff0c;\u52a0 -r \u5b83\u624d\u80af\u8fdb\u95e8\u3002<\/p>\n<hr \/>\n<h3 id=\"\u4e94\u3001\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\uff1a\u770b\u900f\u4ee3\u7801\u7684\u79d8\u5bc6\">\u4e94\u3001\u67e5\u770b\u6587\u4ef6\u5185\u5bb9&#xff1a;\u770b\u900f\u4ee3\u7801\u7684\u79d8\u5bc6<\/h3>\n<h4 id=\"5.1-\u6309\u573a\u666f\u9009\u5de5\u5177\">5.1 \u6309\u573a\u666f\u9009\u5de5\u5177<\/h4>\n<p>cat dictionary.txt         # \u4e00\u6b21\u6027\u5168\u90e8\u8f93\u51fa\u2014\u2014\u9002\u5408\u5c0f\u6587\u4ef6<br \/>\nless UdpServer.hpp         # \u5206\u9875\u67e5\u770b\u2014\u2014\u9002\u5408\u5927\u6587\u4ef6<br \/>\nhead -n 20 dictionary.txt  # \u53ea\u770b\u524d 20 \u884c<br \/>\ntail -n 50 server.log      # \u53ea\u770b\u540e 50 \u884c<\/p>\n<p>\u5404\u81ea\u7684\u9002\u7528\u573a\u666f&#xff1a;<\/p>\n<p>cat&#xff08;concatenate&#xff09;&#xff1a;\u9002\u5408\u51e0 KB \u7684\u5c0f\u6587\u4ef6&#xff0c;\u6bd4\u5982\u6211\u4eec\u7684\u8bcd\u5178\u6587\u4ef6\u3002\u7f3a\u70b9\u662f\u5185\u5bb9\u8d85\u8fc7\u4e00\u5c4f\u5c31\u53ea\u89c1\u7ed3\u5c3e&#xff0c;\u524d\u9762\u7684&#034;\u5237&#034;\u8fc7\u53bb\u4e86\u3002cat -n \u80fd\u5e26\u884c\u53f7\u8f93\u51fa&#xff0c;\u5b9a\u4f4d\u95ee\u9898\u65b9\u4fbf\u3002<\/p>\n<p>less&#xff1a;\u770b\u5927\u6587\u4ef6\u7684\u6b63\u89e3\u3002\u5b83\u4e0d\u4f1a\u4e00\u6b21\u8bfb\u8fdb\u5185\u5b58&#xff0c;\u6309\u9700\u52a0\u8f7d&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u2191\/\u2193 \u6216 j\/k&#xff1a;\u9010\u884c\u6eda\u52a8&#xff1b;\u7a7a\u683c \u6216 f&#xff1a;\u4e0b\u4e00\u9875&#xff1b;b&#xff1a;\u4e0a\u4e00\u9875&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\/\u5173\u952e\u5b57&#xff1a;\u5411\u4e0b\u641c\u7d22&#xff08;\u6309 n \u8df3\u4e0b\u4e00\u4e2a&#xff09;&#xff0c;?\u5173\u952e\u5b57 \u5411\u4e0a\u641c&#xff1b;<\/p>\n<\/li>\n<li>\n<p>g \u8df3\u5230\u6587\u4ef6\u5934&#xff0c;G \u8df3\u5230\u6587\u4ef6\u5c3e&#xff1b;<\/p>\n<\/li>\n<li>\n<p>q \u9000\u51fa\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u770b\u51e0\u5343\u884c\u7684\u65e5\u5fd7\u3001\u7ffb\u522b\u4eba\u7684\u957f\u4ee3\u7801&#xff0c;\u4e00\u5f8b less&#xff0c;\u522b\u7528 cat \u5237\u5c4f\u3002<\/p>\n<p>head \/ tail&#xff1a;\u53ea\u5173\u5fc3\u5934\u6216\u5c3e\u65f6\u7528\u3002\u67e5\u65e5\u5fd7\u51e0\u4e4e\u6c38\u8fdc\u662f tail\u2014\u2014\u6700\u65b0\u7684\u5185\u5bb9\u5728\u6587\u4ef6\u672b\u5c3e\u3002<\/p>\n<p>tail -f&#xff08;follow&#xff09;&#xff1a;\u5b9e\u65f6\u8ffd\u8e2a&#xff0c;\u8fd0\u7ef4\u770b\u5bb6\u672c\u9886<\/p>\n<p>tail -f server.log<\/p>\n<p>\u5b83\u4e0d\u4f1a\u9000\u51fa&#xff0c;\u800c\u662f&#034;\u9489&#034;\u5728\u6587\u4ef6\u672b\u5c3e&#xff0c;\u65b0\u5199\u5165\u7684\u5185\u5bb9\u5b9e\u65f6\u6eda\u51fa\u6765\u3002\u81ea\u5df1\u5199\u670d\u52a1\u5668\u7a0b\u5e8f\u65f6&#xff0c;\u628a\u65e5\u5fd7\u91cd\u5b9a\u5411\u5230\u6587\u4ef6&#xff0c;\u518d\u5f00\u7b2c\u4e8c\u4e2a\u7ec8\u7aef tail -f&#xff0c;\u7b49\u4e8e\u767d\u5ad6\u4e00\u5757\u5b9e\u65f6\u76d1\u63a7\u5c4f\u3002\u6309 Ctrl&#043;C \u9000\u51fa\u8ffd\u8e2a\u3002<\/p>\n<hr \/>\n<h4 id=\"5.2-grep\uff1a\u5728\u6587\u4ef6\u91cc\u5927\u6d77\u635e\u9488\">5.2 grep&#xff1a;\u5728\u6587\u4ef6\u91cc\u5927\u6d77\u635e\u9488<\/h4>\n<p>grep &#034;error&#034; server.log        # \u627e\u51fa\u6240\u6709\u5305\u542b error \u7684\u884c<br \/>\ngrep -n &#034;bind&#034; UdpServer.hpp   # -n \u987a\u5e26\u663e\u793a\u884c\u53f7<br \/>\ngrep -i &#034;Error&#034; server.log     # -i \u5ffd\u7565\u5927\u5c0f\u5199<br \/>\ngrep -v &#034;DEBUG&#034; server.log     # -v \u53cd\u5411&#xff1a;\u6392\u9664\u542b DEBUG \u7684\u884c<br \/>\ngrep -r &#034;TODO&#034; ~\/code          # -r \u9012\u5f52\u641c\u7d22\u6574\u4e2a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6<\/p>\n<p>\u771f\u5b9e\u5de5\u4f5c\u6d41&#xff1a;\u670d\u52a1\u5668\u5d29\u4e86 \u2192 tail -n 100 server.log | grep -i error&#xff0c;\u4e24\u79d2\u949f\u9501\u5b9a\u5acc\u7591\u884c\u3002|&#xff08;\u7ba1\u9053&#xff09;\u7684\u610f\u601d\u662f&#034;\u628a\u524d\u4e00\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa&#xff0c;\u5f53\u6210\u540e\u4e00\u4e2a\u547d\u4ee4\u7684\u8f93\u5165&#034;&#xff0c;\u5b83\u8ba9\u8fd9\u4e9b\u5c0f\u5de5\u5177\u50cf\u79ef\u6728\u4e00\u6837\u81ea\u7531\u62fc\u88c5&#xff1a;<\/p>\n<hr \/>\n<p>grep &#034;\u82f9\u679c&#034; dictionary.txt | wc -l      # \u8bcd\u5178\u91cc\u6709\u51e0\u6761\u542b&#034;\u82f9\u679c&#034;\u7684\u8bb0\u5f55<br \/>\nps aux | grep udpserver                 # \u8fdb\u7a0b\u5217\u8868\u91cc\u627e udpserver<br \/>\nhistory | grep &#034;rm &#034;                    # \u67e5\u67e5\u81ea\u5df1\u5386\u53f2\u4e0a\u6572\u8fc7\u54ea\u4e9b rm&#xff08;\u540e\u6015\u68c0\u6d4b&#xff09;<\/p>\n<p>wc -l&#xff08;word count &#8211; lines&#xff09;\u6570\u884c\u6570&#xff0c;ps aux \u5217\u51fa\u6240\u6709\u8fdb\u7a0b\u2014\u2014\u8fd9\u6761 ps aux | grep xxx \u662f\u67e5&#034;\u6211\u7684\u7a0b\u5e8f\u5230\u5e95\u8dd1\u8d77\u6765\u6ca1\u6709&#034;\u7684\u6807\u51c6\u59ff\u52bf\u3002<\/p>\n<hr \/>\n<h4 id=\"5.3-\u5176\u4ed6\u9ad8\u9891\u5c0f\u5de5\u5177\">5.3 \u5176\u4ed6\u9ad8\u9891\u5c0f\u5de5\u5177<\/h4>\n<p>file udpserver        # \u770b\u6587\u4ef6\u771f\u5b9e\u7c7b\u578b&#xff1a;&#034;ELF 64-bit LSB executable&#034;&#xff08;\u53ef\u6267\u884c\u6587\u4ef6&#xff09;<br \/>\ndu -sh lesson53\/      # \u770b\u8fd9\u4e2a\u76ee\u5f55\u603b\u5171\u5360\u591a\u5927&#xff08;-s \u6c47\u603b -h \u4eba\u7c7b\u53ef\u8bfb&#xff09;<br \/>\ndiff a.cpp b.cpp      # \u9010\u884c\u5bf9\u6bd4\u4e24\u4e2a\u6587\u4ef6\u7684\u5dee\u5f02<\/p>\n<hr \/>\n<h3 id=\"\u516d\u3001\u7f16\u8bd1\u4e0e\u6267\u884c\uff1ac++-\u5f00\u53d1\u8005\u7684\u65e5\u5e38\u5faa\u73af\">\u516d\u3001\u7f16\u8bd1\u4e0e\u6267\u884c&#xff1a;C&#043;&#043; \u5f00\u53d1\u8005\u7684\u65e5\u5e38\u5faa\u73af<\/h3>\n<h4 id=\"6.1-g++-\u76f4\u63a5\u7f16\u8bd1\">6.1 g&#043;&#043; \u76f4\u63a5\u7f16\u8bd1<\/h4>\n<p>g&#043;&#043; UdpServer.cc -o udpserver<br \/>\n.\/udpserver 8080<\/p>\n<ul>\n<li>\n<p>-o udpserver \u6307\u5b9a\u4ea7\u51fa\u7684\u53ef\u6267\u884c\u6587\u4ef6\u540d\u3002\u4e0d\u52a0 -o \u7684\u8bdd&#xff0c;g&#043;&#043; \u9ed8\u8ba4\u628a\u4ea7\u7269\u547d\u540d\u4e3a a.out\u2014\u2014\u591a\u4e2a\u9879\u76ee\u540c\u65f6\u7f16\u8bd1\u5c31\u4e92\u76f8\u8986\u76d6\u4e86&#xff0c;\u6240\u4ee5 -o \u8bf7\u6c38\u8fdc\u5e26\u4e0a\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b8c\u6574\u5f00\u53d1\u7248\u53c2\u6570&#xff1a;g&#043;&#043; -std&#061;c&#043;&#043;17 -pthread -g -Wall UdpServer.cc -o udpserver<\/p>\n<ul>\n<li>\n<p>-std&#061;c&#043;&#043;17&#xff1a;\u542f\u7528 C&#043;&#043;17&#xff08;\u7528\u4e86 std::filesystem \u5c31\u5fc5\u987b\u52a0&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>-pthread&#xff1a;\u94fe\u63a5\u7ebf\u7a0b\u5e93&#xff08;\u7528\u4e86 mutex \u5c31\u5fc5\u987b\u52a0&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>-g&#xff1a;\u52a0\u5165\u8c03\u8bd5\u4fe1\u606f&#xff0c;gdb \u8c03\u8bd5\u5fc5\u9700&#xff1b;<\/p>\n<\/li>\n<li>\n<p>-Wall&#xff1a;\u6253\u5f00\u5168\u90e8\u5e38\u7528\u8b66\u544a\u3002\u5f3a\u70c8\u5efa\u8bae\u5e38\u5f00&#xff0c;\u5f88\u591a&#034;\u80fd\u8dd1\u4f46\u57cb\u96f7&#034;\u7684\u4ee3\u7801&#xff0c;\u8b66\u544a\u65e9\u5c31\u63d0\u9192\u8fc7\u4f60\u4e86\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h4 id=\"6.2-\u4e3a\u4ec0\u4e48\u8fd0\u884c\u5fc5\u987b\u5e26-.\/\uff1f\">6.2 \u4e3a\u4ec0\u4e48\u8fd0\u884c\u5fc5\u987b\u5e26 .\/&#xff1f;<\/h4>\n<p>\u65b0\u624b\u5fc5\u8e29&#xff1a;\u660e\u660e\u6587\u4ef6\u5c31\u5728\u773c\u524d&#xff0c;\u6572 udpserver \u5374\u63d0\u793a command not found\u3002<\/p>\n<p>\u539f\u56e0&#xff1a;shell \u6536\u5230\u4e00\u4e2a\u88f8\u547d\u4ee4\u65f6&#xff0c;\u53ea\u4f1a\u53bb\u73af\u5883\u53d8\u91cf PATH \u5217\u51fa\u7684\u76ee\u5f55&#xff08;\/usr\/bin \u7b49&#xff09;\u91cc\u627e\u3002\u4f60\u5f53\u524d\u76ee\u5f55\u4e0d\u5728 PATH \u91cc&#xff0c;\u8fd9\u662f\u5b89\u5168\u8bbe\u8ba1\u2014\u2014\u9632\u6b62\u6709\u4eba\u5728\u516c\u5171\u76ee\u5f55\u653e\u4e00\u4e2a\u4f2a\u88c5\u6210 ls \u7684\u6076\u610f\u811a\u672c\u9a97\u4f60\u6267\u884c\u3002<\/p>\n<p>\u6240\u4ee5\u8fd0\u884c\u5f53\u524d\u76ee\u5f55\u7684\u7a0b\u5e8f\u5fc5\u987b\u663e\u5f0f\u5199\u51fa\u8def\u5f84&#xff1a;.\/udpserver&#xff0c;\u544a\u8bc9 shell&#034;\u5c31\u662f\u5f53\u524d\u76ee\u5f55\u4e0b\u8fd9\u4e2a&#034;\u3002\u540c\u7406&#xff0c;\/home\/ubuntu\/code\/lesson53\/udpserver 8080 \u8fd9\u79cd\u7edd\u5bf9\u8def\u5f84\u5199\u6cd5\u4e5f\u80fd\u8dd1\u3002<\/p>\n<hr \/>\n<h4 id=\"6.3-make\uff1a\u8ba9-makefile-\u66ff\u4f60\u6572\u547d\u4ee4\">6.3 make&#xff1a;\u8ba9 Makefile \u66ff\u4f60\u6572\u547d\u4ee4<\/h4>\n<p>make               # \u6309 Makefile \u91cc\u7684\u89c4\u5219\u7f16\u8bd1\u9879\u76ee<br \/>\nmake clean         # \u6267\u884c clean \u89c4\u5219&#xff0c;\u5220\u9664\u7f16\u8bd1\u4ea7\u7269<br \/>\nmake clean &amp;&amp; make # \u6e05\u7406\u540e\u91cd\u65b0\u7f16\u8bd1&#xff1a;\u9047\u5230\u5947\u602a\u9519\u8bef\u65f6\u7684&#034;\u91cd\u542f\u5927\u6cd5&#034;<\/p>\n<p>&amp;&amp; \u8868\u793a\u524d\u4e00\u6761\u6210\u529f\u624d\u6267\u884c\u540e\u4e00\u6761\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e2a\u6211\u771f\u5b9e\u8e29\u8fc7\u7684\u5751&#xff0c;\u503c\u5f97\u5199\u8fdb\u8b66\u793a\u5f55&#xff1a;Makefile \u91cc\u5199\u5728\u7b2c\u4e00\u884c\u7684\u76ee\u6807\u5c31\u662f\u6572 make \u65f6\u9ed8\u8ba4\u6267\u884c\u7684\u3002\u6709\u4e00\u6b21\u6211\u7684 Makefile \u53ea\u5199\u4e86 clean \u89c4\u5219\u6ca1\u5199\u7f16\u8bd1\u89c4\u5219&#xff0c;\u7ed3\u679c\u6572 make \u60f3\u7f16\u8bd1&#xff0c;\u5b9e\u9645\u6267\u884c\u7684\u662f rm -f udpclient udpserver\u2014\u2014\u4e0d\u4f46\u6ca1\u7f16\u8bd1&#xff0c;\u8fd8\u628a\u4ec5\u6709\u7684\u4e24\u4e2a\u4e8c\u8fdb\u5236\u5220\u4e86\u3002\u5f53\u65f6\u6ee1\u8111\u5b50\u95ee\u53f7&#034;\u7a0b\u5e8f\u600e\u4e48\u51ed\u7a7a\u6d88\u5931\u4e86&#034;&#xff0c;\u5bf9\u7740 ls \u6123\u4e86\u534a\u5929\u3002<\/p>\n<p>\u7531\u6b64\u5f97\u51fa\u4e24\u6761\u94c1\u5f8b&#xff1a;<\/p>\n<li>\n<p>all \u76ee\u6807\u6c38\u8fdc\u653e Makefile \u7b2c\u4e00\u884c&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u6539\u4e86 .hpp \u5934\u6587\u4ef6\u540e&#xff0c;\u76f4\u63a5 make \u7ecf\u5e38\u63d0\u793a Nothing to be done\u2014\u2014\u56e0\u4e3a Makefile \u7684\u4f9d\u8d56\u53ea\u5199\u4e86 .cc&#xff0c;make \u4e0d\u77e5\u9053\u5934\u6587\u4ef6\u53d8\u4e86\u3002\u8001\u5b9e\u7528 make clean &amp;&amp; make&#xff0c;\u7b49\u4ee5\u540e\u5b66\u4f1a\u81ea\u52a8\u751f\u6210\u5934\u6587\u4ef6\u4f9d\u8d56\u518d\u8fdb\u5316\u3002<\/p>\n<\/li>\n<hr \/>\n<h4 id=\"6.4-\u8fd0\u884c\u65f6\u7684\u6551\u547d\u4e09\u952e\">6.4 \u8fd0\u884c\u65f6\u7684\u6551\u547d\u4e09\u952e<\/h4>\n<table>\n<tbody>\n<tr>\n<p>\u6309\u952e<\/p>\n<p>\u4f5c\u7528<\/p>\n<p>\u573a\u666f<\/p>\n<\/tr>\n<tr>\n<td>\n<p>Ctrl &#043; C<\/p>\n<\/td>\n<td>\n<p>\u53d1 SIGINT \u4fe1\u53f7&#xff0c;\u7ec8\u6b62\u524d\u53f0\u8fdb\u7a0b<\/p>\n<\/td>\n<td>\n<p>\u670d\u52a1\u5668\u6b7b\u5faa\u73af\u3001\u7a0b\u5e8f\u5361\u6b7b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Ctrl &#043; D<\/p>\n<\/td>\n<td>\n<p>\u8868\u793a\u8f93\u5165\u7ed3\u675f&#xff08;EOF&#xff09;<\/p>\n<\/td>\n<td>\n<p>\u4ea4\u4e92\u7a0b\u5e8f\u8bfb\u5230\u5b83\u5c31\u77e5\u9053&#034;\u6ca1\u8bdd\u8bf4\u4e86&#034;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Ctrl &#043; Z<\/p>\n<\/td>\n<td>\n<p>\u6682\u505c\u8fdb\u7a0b&#xff08;\u4e0d\u662f\u7ed3\u675f&#xff09;<\/p>\n<\/td>\n<td>\n<p>\u914d\u5408 bg \u653e\u540e\u53f0\u3001fg \u8c03\u56de\u524d\u53f0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u533a\u5206 Ctrl&#043;C \u548c Ctrl&#043;D \u5f88\u91cd\u8981&#xff1a;\u524d\u8005\u662f&#034;\u6740\u4e86\u5b83&#034;&#xff0c;\u540e\u8005\u662f&#034;\u8bdd\u8bf4\u5b8c\u4e86&#034;\u3002\u6211\u4eec\u5199 UDP \u5ba2\u6237\u7aef\u65f6\u8e29\u8fc7\u4e00\u4e2a\u5751&#xff1a;\u6ca1\u68c0\u67e5 Ctrl&#043;D&#xff08;EOF&#xff09;\u65f6 getline \u7684\u8fd4\u56de\u503c&#xff0c;\u7ed3\u679c\u8f93\u5165\u6d41\u7ed3\u675f\u540e\u7a0b\u5e8f\u9677\u5165\u6b7b\u5faa\u73af&#xff0c;\u51e0\u79d2\u949f\u5237\u51fa\u51e0\u5341 MB \u5783\u573e\u8f93\u51fa\u3002\u952e\u76d8\u4e0a\u7684\u6bcf\u4e00\u4e2a\u7ec4\u5408\u952e&#xff0c;\u7a0b\u5e8f\u90fd\u662f\u80fd\u611f\u77e5\u7684&#xff0c;\u522b\u88f8\u5954\u3002<\/p>\n<hr \/>\n<h4 id=\"6.5-\u540e\u53f0\u8fd0\u884c\u4e0e\u8fdb\u7a0b\u7ba1\u7406\uff08\u8fd0\u7ef4\u9884\u5907\u77e5\u8bc6\uff09\">6.5 \u540e\u53f0\u8fd0\u884c\u4e0e\u8fdb\u7a0b\u7ba1\u7406&#xff08;\u8fd0\u7ef4\u9884\u5907\u77e5\u8bc6&#xff09;<\/h4>\n<p>.\/udpserver 8080 &amp;        # &amp; \u8ba9\u7a0b\u5e8f\u5230\u540e\u53f0\u8dd1&#xff0c;\u7ec8\u7aef\u7acb\u523b\u7a7a\u51fa\u6765<br \/>\njobs                      # \u770b\u5f53\u524d\u4f1a\u8bdd\u7684\u540e\u53f0\u4efb\u52a1<br \/>\nkill %1                   # \u7ed3\u675f 1 \u53f7\u540e\u53f0\u4efb\u52a1<br \/>\npkill udpserver           # \u6309\u540d\u5b57\u7ed3\u675f\u6240\u6709\u53eb udpserver \u7684\u8fdb\u7a0b<br \/>\nss -ulnp | grep 8080      # \u67e5 8080 \u7aef\u53e3\u88ab\u54ea\u4e2a\u8fdb\u7a0b\u5360\u7740<\/p>\n<p>ss -ulnp | grep \u7aef\u53e3\u53f7 \u662f\u6392\u67e5 bind error \u7684\u6807\u51c6\u52a8\u4f5c&#xff1a;\u8f93\u51fa\u91cc pid&#061;xxx \u76f4\u63a5\u544a\u8bc9\u4f60\u5360\u7528\u8005\u662f\u8c01&#xff0c;kill xxx \u91ca\u653e\u7aef\u53e3\u3002\u670d\u52a1\u5668\u7aef\u53e3\u7684&#034;\u5360\u7528\u4e0e\u53cd\u5360\u7528&#034;&#xff0c;\u662f\u6bcf\u4e2a\u5199\u7f51\u7edc\u7a0b\u5e8f\u7684\u4eba\u8fdf\u65e9\u90fd\u8981\u9762\u5bf9\u7684\u65e5\u5e38\u3002<\/p>\n<hr \/>\n<h3 id=\"\u4e03\u3001\u6743\u9650\u4e0e\u73af\u5883\uff1a\u4ece&quot;\u80fd\u7528&quot;\u5230&quot;\u987a\u624b&quot;\">\u4e03\u3001\u6743\u9650\u4e0e\u73af\u5883&#xff1a;\u4ece&#034;\u80fd\u7528&#034;\u5230&#034;\u987a\u624b&#034;<\/h3>\n<h4 id=\"7.1-chmod\uff1a\u628a\u6587\u4ef6\u53d8\u6210\u53ef\u6267\u884c\u7684\">7.1 chmod&#xff1a;\u628a\u6587\u4ef6\u53d8\u6210\u53ef\u6267\u884c\u7684<\/h4>\n<p>\u56de\u770b\u7b2c\u4e00\u8282 ls -l \u91cc\u90a3\u4e32 rwxrwxr-x\u3002\u6539\u5b83\u7528 chmod&#xff1a;<\/p>\n<p>chmod &#043;x build.sh          # \u7ed9\u6240\u6709\u7528\u6237\u52a0\u53ef\u6267\u884c\u6743\u9650&#xff08;\u6700\u5e38\u7528&#xff09;<br \/>\nchmod 755 udpserver        # \u6570\u5b57\u6cd5&#xff1a;\u6240\u6709\u8005 rwx(7)&#xff0c;\u7ec4 r-x(5)&#xff0c;\u5176\u4ed6 r-x(5)<br \/>\nchmod 644 config.txt       # \u6240\u6709\u8005 rw(6)&#xff0c;\u7ec4\u548c\u5176\u4ed6 r(4)&#xff1a;\u7eaf\u6587\u672c\u6587\u4ef6\u7684\u5e38\u89c4\u914d\u7f6e<\/p>\n<p>\u6570\u5b57\u6cd5\u7684\u6362\u7b97\u662f\u4e8c\u8fdb\u5236\u601d\u7ef4&#xff1a;r&#061;4, w&#061;2, x&#061;1&#xff0c;\u4e09\u4e2a\u4f4d\u76f8\u52a0\u30027&#061;4&#043;2&#043;1&#061;rwx&#xff0c;6&#061;4&#043;2&#061;rw&#xff0c;5&#061;4&#043;1&#061;r-x\u3002\u5199\u811a\u672c\u6700\u5e38\u89c1\u7684\u4e00\u6b65\u5c31\u662f\u521a\u5199\u5b8c\u7684 xxx.sh \u6572\u4e0b\u53bb\u63d0\u793a Permission denied\u2014\u2014chmod &#043;x \u4e00\u4e0b\u5c31\u597d\u3002<\/p>\n<hr \/>\n<h4 id=\"7.2-sudo\uff1a\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u505a\u4e8b\">7.2 sudo&#xff1a;\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u505a\u4e8b<\/h4>\n<p>sudo apt install g&#043;&#043;       # \u5b89\u88c5\u8f6f\u4ef6\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650<\/p>\n<p>sudo&#xff08;superuser do&#xff09;\u8ba9\u666e\u901a\u7528\u6237\u4e34\u65f6\u501f root \u7684\u6743\u9650\u5e72\u4e00\u4ef6\u4e8b\u3002\u539f\u5219&#xff1a;\u80fd\u4e0d\u7528\u5c31\u4e0d\u7528\u3002\u65e5\u5e38\u5199\u4ee3\u7801\u3001\u7f16\u8bd1\u3001\u8dd1\u81ea\u5df1\u7684\u670d\u52a1\u5668\u90fd\u5728\u5bb6\u76ee\u5f55\u91cc\u5b8c\u6210&#xff0c;\u5b8c\u5168\u4e0d\u9700\u8981 sudo&#xff1b;\u9700\u8981 sudo \u7684\u5178\u578b\u573a\u666f\u662f\u88c5\u8f6f\u4ef6\u3001\u6539\u7cfb\u7edf\u914d\u7f6e\u3002sudo \u63a5\u7ba1\u7684\u64cd\u4f5c\u6ca1\u6709\u540e\u6094\u836f&#xff0c;\u6743\u9650\u8d8a\u5927&#xff0c;\u624b\u6ed1\u7684\u4ee3\u4ef7\u8d8a\u5927\u3002<\/p>\n<hr \/>\n<h4 id=\"7.3-\u6548\u7387\u4e09\u4ef6\u5957\">7.3 \u6548\u7387\u4e09\u4ef6\u5957<\/h4>\n<p>clear          # \u6e05\u5c4f&#xff08;\u5feb\u6377\u952e Ctrl&#043;L&#xff0c;\u66f4\u5feb&#xff09;<br \/>\nhistory        # \u5217\u51fa\u6572\u8fc7\u7684\u6240\u6709\u5386\u53f2\u547d\u4ee4&#xff08;\u5e26\u7f16\u53f7&#xff09;<br \/>\n!\u7f16\u53f7           # \u91cd\u65b0\u6267\u884c history \u91cc\u5bf9\u5e94\u7f16\u53f7\u7684\u547d\u4ee4<br \/>\nalias ll&#061;&#039;ls -lha&#039;   # \u7ed9\u957f\u547d\u4ee4\u8d77\u77ed\u540d&#xff08;\u5199\u8fdb ~\/.bashrc \u5c31\u6c38\u4e45\u751f\u6548&#xff09;<\/p>\n<p>history \u9664\u4e86\u7ffb\u65e7\u8d26&#xff0c;\u8fd8\u6709\u4e2a\u9690\u85cf\u4ef7\u503c&#xff1a;\u65b0\u63a5\u624b\u4e00\u53f0\u673a\u5668\u6216\u5fd8\u4e86\u81ea\u5df1\u524d\u51e0\u5929\u600e\u4e48\u7f16\u8bd1\u7684&#xff0c;\u7ffb history \u6bd4\u7ffb\u804a\u5929\u8bb0\u5f55\u9760\u8c31\u3002<\/p>\n<hr \/>\n<h4 id=\"7.4-\u67e5\u547d\u4ee4\u7528\u6cd5\uff1a\u522b\u80cc\uff0c\u4f1a\u67e5\u5c31\u884c\">7.4 \u67e5\u547d\u4ee4\u7528\u6cd5&#xff1a;\u522b\u80cc&#xff0c;\u4f1a\u67e5\u5c31\u884c<\/h4>\n<p>man rm          # \u5b8c\u6574\u624b\u518c&#xff08;q \u9000\u51fa&#xff09;<br \/>\nrm &#8211;help       # \u5feb\u901f\u7248\u5e2e\u52a9<br \/>\nwhich ls        # \u770b ls \u8fd9\u4e2a\u547d\u4ee4\u5b9e\u9645\u662f\u54ea\u4e2a\u6587\u4ef6&#xff08;\/usr\/bin\/ls&#xff09;<\/p>\n<p>\u547d\u4ee4\u7684\u53c2\u6570\u6c38\u8fdc\u8bb0\u4e0d\u5168&#xff0c;\u4f1a\u67e5\u7684\u4eba\u624d\u662f\u9ad8\u624b\u3002man \u9875\u91cc \u547d\u4ee4\u540d\u79f0(\u6570\u5b57) \u7684\u6570\u5b57\u6709\u8bb2\u7a76&#xff1a;1 \u662f\u666e\u901a\u547d\u4ee4&#xff0c;2 \u662f\u7cfb\u7edf\u8c03\u7528&#xff0c;3 \u662f\u5e93\u51fd\u6570\u2014\u2014man 2 bind \u67e5\u7684\u662f socket \u7684 bind&#xff0c;man 3 printf \u67e5\u7684\u662f C \u51fd\u6570&#xff0c;\u8fd9\u4e5f\u662f\u5199\u7f51\u7edc\u7a0b\u5e8f\u67e5 socket\u3001recvfrom \u6587\u6863\u7684\u6b63\u786e\u5165\u53e3\u3002<\/p>\n<hr \/>\n<h3 id=\"\u516b\u3001\u5b9e\u6218\u590d\u76d8\uff1a\u4ece-lesson52-\u5230-lesson53-\u7684\u6b63\u786e\u59ff\u52bf\">\u516b\u3001\u5b9e\u6218\u590d\u76d8&#xff1a;\u4ece lesson52 \u5230 lesson53 \u7684\u6b63\u786e\u59ff\u52bf<\/h3>\n<p>\u7406\u8bba\u8bb2\u5b8c&#xff0c;\u590d\u76d8\u4e00\u4e2a\u521a\u53d1\u751f\u7684\u771f\u5b9e\u6848\u4f8b&#xff1a;\u628a lesson52 \u76ee\u5f55\u7684\u5168\u90e8\u5185\u5bb9\u8fc1\u79fb&#xff0c;\u4f5c\u4e3a\u65b0\u9879\u76ee lesson53 \u7684\u8d77\u70b9\u3002<\/p>\n<h4 id=\"8.1-\u9519\u8bef\u793a\u8303\">8.1 \u9519\u8bef\u793a\u8303<\/h4>\n<p>\u4eba\u7ad9\u5728 lesson53 \u91cc&#xff0c;\u6572&#xff1a;<\/p>\n<p>mv lesson52 lesson53<br \/>\n# mv: cannot stat &#039;lesson52&#039;: No such file or directory<\/p>\n<p>\u62a5\u9519\u539f\u56e0&#xff1a;lesson52 \u6839\u672c\u4e0d\u5728\u5f53\u524d\u76ee\u5f55&#xff0c;\u800c\u5728\u4e0a\u4e00\u7ea7 code\/ \u91cc\u3002\u76f8\u5bf9\u8def\u5f84\u662f\u7ad9\u5728\u4f60\u73b0\u5728\u7684\u4f4d\u7f6e\u7b97\u7684\u2014\u2014&#034;\u9694\u58c1\u90a3\u680b\u697c&#034;\u7684\u8bf4\u6cd5\u53ea\u5728\u540c\u4e00\u4e2a\u8857\u533a\u6709\u6548\u3002ls \u4e00\u4e0b\u5c31\u4f1a\u53d1\u73b0\u5f53\u524d\u76ee\u5f55\u91cc\u6839\u672c\u6ca1\u6709 lesson52 \u8fd9\u4e2a\u540d\u5b57\u3002<\/p>\n<hr \/>\n<h4 id=\"8.2-\u6b63\u786e\u505a\u6cd5\uff08\u4e09\u79cd\uff0c\u6309\u573a\u666f\u9009\uff09\">8.2 \u6b63\u786e\u505a\u6cd5&#xff08;\u4e09\u79cd&#xff0c;\u6309\u573a\u666f\u9009&#xff09;<\/h4>\n<p>\u505a\u6cd5\u4e00&#xff1a;\u7ad9\u5728 lesson53 \u91cc&#xff0c;\u642c\u4e0a\u4e00\u7ea7\u7684\u5185\u5bb9\u8fdb\u6765&#xff08;\u6211\u5f53\u65f6\u7528\u7684&#xff09;<\/p>\n<p>pwd                 # \/home\/ubuntu\/code\/lesson53<br \/>\nmv ..\/lesson52\/* .<\/p>\n<p>..\/lesson52\/* \u662f&#034;\u4e0a\u4e00\u7ea7\u7684 lesson52 \u91cc\u7684\u6240\u6709&#xff08;\u975e\u9690\u85cf&#xff09;\u6587\u4ef6&#034;&#xff0c;. \u662f&#034;\u5f53\u524d\u76ee\u5f55&#034;\u3002\u642c\u5b8c ls \u9a8c\u6536&#xff0c;\u5341\u4e8c\u4e2a\u6587\u4ef6\u5168\u5230\u9f50\u3002<\/p>\n<p>\u505a\u6cd5\u4e8c&#xff1a;\u7ad9\u5728\u4e0a\u4e00\u7ea7&#xff0c;\u76f4\u63a5\u6539\u540d\u2014\u2014\u5982\u679c lesson53 \u8fd8\u4e0d\u5b58\u5728&#xff0c;\u8fd9\u662f\u6700\u5e72\u51c0\u7684\u65b9\u6848<\/p>\n<p>cd ..<br \/>\nmv lesson52 lesson53     # \u6574\u4e2a\u76ee\u5f55\u6539\u540d&#xff0c;\u4e00\u6b65\u5230\u4f4d<\/p>\n<p>\u6ce8\u610f\u8fd9\u91cc\u7684\u884c\u4e3a\u7ec6\u8282&#xff1a;mv \u6539\u540d\u76ee\u5f55\u65f6&#xff0c;\u5982\u679c\u76ee\u6807\u540d\u4e0d\u5b58\u5728&#xff0c;\u5c31\u662f\u7eaf\u6539\u540d&#xff1b;\u5982\u679c\u76ee\u6807\u540d\u5df2\u5b58\u5728&#xff08;\u6bd4\u5982 lesson53 \u5df2\u7ecf\u6709\u4e86&#xff09;&#xff0c;mv \u4f1a\u628a lesson52 \u6574\u4e2a\u585e\u8fdb lesson53 \u91cc\u9762\u53bb&#xff08;\u53d8\u6210 lesson53\/lesson52&#xff09;\u3002\u6240\u4ee5\u6539\u540d\u524d\u5148 ls \u786e\u8ba4\u76ee\u6807\u540d\u4e0d\u5b58\u5728\u3002<\/p>\n<p>\u505a\u6cd5\u4e09&#xff1a;\u53ea\u60f3\u590d\u5236\u4e0d\u60f3\u642c\u5bb6<\/p>\n<p>cd ~\/code<br \/>\ncp -r lesson52 lesson53    # \u539f\u76ee\u5f55\u539f\u5c01\u4e0d\u52a8&#xff0c;\u590d\u5236\u4e00\u4efd\u51fa\u6765<\/p>\n<p>lesson52 \u7684\u4ee3\u7801\u4ee5\u540e\u53ef\u80fd\u8fd8\u8981\u56de\u770b&#xff0c;\u7528 cp -r \u6700\u7a33\u59a5&#xff0c;\u4ee3\u4ef7\u662f\u591a\u5360\u4e00\u4efd\u78c1\u76d8\u3002<\/p>\n<hr \/>\n<h4 id=\"8.3-\u4e09\u79cd\u65b9\u6848\u600e\u4e48\u9009\">8.3 \u4e09\u79cd\u65b9\u6848\u600e\u4e48\u9009<\/h4>\n<table>\n<tbody>\n<tr>\n<p>\u573a\u666f<\/p>\n<p>\u63a8\u8350<\/p>\n<\/tr>\n<tr>\n<td>\n<p>\u65e7\u76ee\u5f55\u4e0d\u518d\u9700\u8981&#xff0c;\u5f7b\u5e95\u642c\u5bb6<\/p>\n<\/td>\n<td>\n<p>cd .. &amp;&amp; mv lesson52 lesson53<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u65b0\u65e7\u76ee\u5f55\u90fd\u8981\u4fdd\u7559&#xff08;\u6bd4\u5982 lesson52 \u91cc\u8fd8\u6709\u522b\u7684\u8bfe\u7684\u4e1c\u897f&#xff09;<\/p>\n<\/td>\n<td>\n<p>cp -r<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u65b0\u76ee\u5f55\u5df2\u5b58\u5728&#xff0c;\u53ea\u60f3\u628a\u65e7\u9879\u76ee\u7684\u6587\u4ef6\u642c\u8fdb\u53bb<\/p>\n<\/td>\n<td>\n<p>\u7ad9\u5728\u65b0\u76ee\u5f55\u91cc mv ..\/\u65e7\u76ee\u5f55\/* .<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h4 id=\"8.4-\u4e8b\u540e\u9a8c\u6536\u6e05\u5355\">8.4 \u4e8b\u540e\u9a8c\u6536\u6e05\u5355<\/h4>\n<p>\u642c\u5bb6\u4e0d\u662f\u6572\u5b8c\u547d\u4ee4\u5c31\u5b8c\u4e86&#xff0c;\u56db\u6b65\u9a8c\u6536&#xff1a;<\/p>\n<p>ls                    # 1. \u6587\u4ef6\u90fd\u5230\u4e86\u5417&#xff1f;\u6570\u91cf\u5bf9\u5417&#xff1f;<br \/>\nls ..\/lesson52 -a     # 2. \u65e7\u76ee\u5f55\u8fd8\u5269\u4ec0\u4e48&#xff1f;\u9690\u85cf\u6587\u4ef6&#xff08;.git \u7b49&#xff09;\u642c\u4e86\u5417&#xff1f;<br \/>\nmake clean &amp;&amp; make    # 3. \u8fd8\u80fd\u7f16\u8bd1\u901a\u8fc7\u5417&#xff1f;&#xff08;\u80fd\u7f16\u8fc7 &#061; \u6e90\u6587\u4ef6\u6ca1\u7f3a&#xff09;<br \/>\n.\/udpserver 8080      # 4. \u8fd8\u80fd\u8dd1\u5417&#xff1f;<\/p>\n<p>\u7b2c 2 \u6b65\u7279\u522b\u5bb9\u6613\u5ffd\u7565&#xff1a;mv dir\/* . \u4e0d\u4f1a\u642c .git\u3001.gitignore \u8fd9\u7c7b\u9690\u85cf\u6587\u4ef6&#xff0c;\u9879\u76ee&#034;\u642c\u5bb6\u4e0d\u642c\u5386\u53f2&#034;\u5c31\u662f\u8fd9\u4e48\u53d1\u751f\u7684\u3002<\/p>\n<hr \/>\n<h3 id=\"\u4e5d\u3001\u7ffb\u8f66\u73b0\u573a\u6025\u6551\u8868\">\u4e5d\u3001\u7ffb\u8f66\u73b0\u573a\u6025\u6551\u8868<\/h3>\n<p>\u628a\u672c\u6587\u6240\u6709\u547d\u4ee4\u7684&#034;\u6700\u5e38\u89c1\u62a5\u9519 \u2192 \u539f\u56e0 \u2192 \u89e3\u6cd5&#034;\u6c47\u603b\u6210\u4e00\u5f20\u8868&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\n<p>\u62a5\u9519\/\u73b0\u8c61<\/p>\n<p>\u6839\u56e0<\/p>\n<p>\u89e3\u6cd5<\/p>\n<\/tr>\n<tr>\n<td>\n<p>No such file or directory<\/p>\n<\/td>\n<td>\n<p>\u8def\u5f84\u62fc\u9519 \/ \u4eba\u7ad9\u9519\u4e86\u76ee\u5f55<\/p>\n<\/td>\n<td>\n<p>pwd &#043; ls \u91cd\u65b0\u5b9a\u4f4d<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Permission denied&#xff08;\u8fd0\u884c\u7a0b\u5e8f&#xff09;<\/p>\n<\/td>\n<td>\n<p>\u6ca1\u6709 x \u6743\u9650<\/p>\n<\/td>\n<td>\n<p>chmod &#043;x \u6587\u4ef6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Permission denied&#xff08;\u7cfb\u7edf\u76ee\u5f55&#xff09;<\/p>\n<\/td>\n<td>\n<p>\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650<\/p>\n<\/td>\n<td>\n<p>sudo&#xff08;\u60f3\u6e05\u695a\u518d\u7528&#xff09;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Is a directory&#xff08;rm \u62a5\u9519&#xff09;<\/p>\n<\/td>\n<td>\n<p>\u5220\u76ee\u5f55\u5fc5\u987b\u9012\u5f52<\/p>\n<\/td>\n<td>\n<p>rm -r \u76ee\u5f55<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>omitting directory&#xff08;cp \u62a5\u9519&#xff09;<\/p>\n<\/td>\n<td>\n<p>\u590d\u5236\u76ee\u5f55\u5fc5\u987b\u9012\u5f52<\/p>\n<\/td>\n<td>\n<p>cp -r \u6e90\u76ee\u5f55 \u76ee\u6807<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>command not found&#xff08;\u672c\u5730\u7a0b\u5e8f&#xff09;<\/p>\n<\/td>\n<td>\n<p>\u5c11\u4e86 .\/ \u524d\u7f00<\/p>\n<\/td>\n<td>\n<p>.\/\u7a0b\u5e8f\u540d<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u6572 make \u53cd\u800c\u5220\u4e86\u6587\u4ef6<\/p>\n<\/td>\n<td>\n<p>Makefile \u7b2c\u4e00\u4e2a\u76ee\u6807\u662f clean<\/p>\n<\/td>\n<td>\n<p>all \u653e\u7b2c\u4e00\u884c&#xff0c;\u518d make<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u6539\u4e86 hpp \u7f16\u8bd1\u6ca1\u751f\u6548<\/p>\n<\/td>\n<td>\n<p>make \u4e0d\u8ffd\u8e2a\u5934\u6587\u4ef6\u4f9d\u8d56<\/p>\n<\/td>\n<td>\n<p>make clean &amp;&amp; make<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>bind error<\/p>\n<\/td>\n<td>\n<p>\u7aef\u53e3\u88ab\u5360<\/p>\n<\/td>\n<td>\n<p>ss -ulnp | grep \u7aef\u53e3 \u2192 kill pid<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>mv \u540e\u6587\u4ef6&#034;\u6d88\u5931&#034;<\/p>\n<\/td>\n<td>\n<p>\u76ee\u6807\u540d\u4e0d\u5b58\u5728&#xff0c;mv \u53d8\u6210\u4e86\u6539\u540d<\/p>\n<\/td>\n<td>\n<p>\u53bb ls \u627e\u62fc\u9519\u7684\u65b0\u540d\u5b57<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u642c\u5bb6\u540e .git \u4e0d\u89c1\u4e86<\/p>\n<\/td>\n<td>\n<p>* \u4e0d\u542b\u9690\u85cf\u6587\u4ef6<\/p>\n<\/td>\n<td>\n<p>mv dir\/.[!.]* \u76ee\u6807\/<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3 id=\"\u5341\u3001\u77e5\u8bc6\u56fe\u8c31\uff1a\u628a\u547d\u4ee4\u7ec7\u6210\u7f51\">\u5341\u3001\u77e5\u8bc6\u56fe\u8c31&#xff1a;\u628a\u547d\u4ee4\u7ec7\u6210\u7f51<\/h3>\n<p>\u6700\u540e\u628a\u8fd9\u4efd\u6307\u5357\u6536\u62e2\u6210\u4e00\u5f20\u7f51\u3002\u6240\u6709\u547d\u4ee4\u5176\u5b9e\u5206\u6210\u4e94\u7c7b&#xff0c;\u6bcf\u7c7b\u8bb0\u4e00\u4e2a&#034;\u4ee3\u8868\u4eba\u7269&#034;\u5c31\u591f\u4e86&#xff1a;<\/p>\n<p>                         Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c<br \/>\n                                  \u2502<br \/>\n    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n    \u2502          \u2502          \u2502            \u2502          \u2502          \u2502<br \/>\n \u5b9a\u4f4d\u5bfc\u822a     \u67e5\u770b\u5185\u5bb9     \u521b\u5efa\u5220\u9664      \u642c\u8fd0\u590d\u5236     \u7f16\u8bd1\u6267\u884c     \u6743\u9650\u7ba1\u7406<br \/>\n    \u2502          \u2502          \u2502            \u2502          \u2502          \u2502<br \/>\n  pwd \u6211\u5728\u54ea   cat \u6574\u4f53\u770b  touch \u5efa\u6587\u4ef6  mv \u526a\u5207\/\u6539\u540d g&#043;&#043; \u7f16\u8bd1   chmod \u52a0\u6743\u9650<br \/>\n  ls \u6709\u4ec0\u4e48    less \u5206\u9875\u770b mkdir \u5efa\u76ee\u5f55 cp  \u590d\u5236    make \u5de5\u7a0b  sudo \u501f\u6743\u9650<br \/>\n  cd \u53bb\u54ea\u91cc    head\/tail  mkdir -p \u9012\u5f52 cp -r \u9012\u5f52  .\/ \u8fd0\u884c    \u6570\u5b57\u6cd5 421<br \/>\n   .  \u5f53\u524d     tail -f \u8ffd\u65e5\u5fd7  rm -r\/-f  \u901a\u914d\u7b26 *    Ctrl&#043;C \u6740<br \/>\n   ..  \u4e0a\u7ea7    grep \u641c\u7d22       (\u5371\u9669!)   (\u4e0d\u542b\u9690\u85cf)  Ctrl&#043;D EOF<br \/>\n    \u2502          \u2502<br \/>\n    \u2514\u2500\u2500 \u7ba1\u9053 | \u628a\u5b83\u4eec\u4e32\u8d77\u6765&#xff1a;tail -f log | grep error<\/p>\n<p>\u51e0\u6761\u538b\u7bb1\u5e95\u7684\u539f\u5219&#xff0c;\u6bd4\u4efb\u4f55\u547d\u4ee4\u90fd\u503c\u94b1&#xff1a;<\/p>\n<li>\n<p>\u52a8\u624b\u4e09\u8fde&#xff1a;pwd&#xff08;\u6211\u5728\u54ea&#xff09;\u2192 ls&#xff08;\u8fd9\u91cc\u6709\u4ec0\u4e48&#xff09;\u2192 \u518d\u64cd\u4f5c\u3002\u4e94\u79d2\u949f&#xff0c;\u4fdd\u5e73\u5b89\u3002<\/p>\n<\/li>\n<li>\n<p>mv \u4e0e cp \u4e4b\u95f4\u72b9\u8c6b\u65f6&#xff0c;\u9009 cp\u3002\u591a\u4e00\u4efd\u6587\u4ef6\u4e0d\u788d\u4e8b&#xff0c;\u5c11\u4e00\u4efd\u4ee3\u7801\u4f1a\u8981\u547d\u3002<\/p>\n<\/li>\n<li>\n<p>rm -f \u662f\u624b\u96f7&#xff0c;\u62d4\u4e86\u4fdd\u9669&#xff08;-f&#xff09;\u5c31\u610f\u5473\u7740\u6ca1\u6709\u56de\u5934\u8def&#xff1b;\u80fd\u7528 rm -r \u5c31\u522b\u52a0 f\u3002<\/p>\n<\/li>\n<li>\n<p>\u62a5\u9519\u4fe1\u606f\u662f\u670b\u53cb\u3002No such file or directory\u3001Is a directory\u3001Permission denied \u6bcf\u4e00\u53e5\u90fd\u5728\u51c6\u786e\u544a\u8bc9\u4f60\u54ea\u91cc\u4e0d\u5bf9&#xff0c;\u8bfb\u62a5\u9519\u6bd4\u778e\u731c\u5feb\u5341\u500d\u3002<\/p>\n<\/li>\n<li>\n<p>man \u548c &#8211;help \u662f\u7ec8\u6781\u6587\u6863\u3002\u547d\u4ee4\u53c2\u6570\u80cc\u4e0d\u5b8c&#xff0c;\u4f1a\u67e5\u7684\u4eba\u624d\u662f\u8fd0\u7ef4\u3002<\/p>\n<\/li>\n<p>\u522b\u6015\u6572\u547d\u4ee4\u3002\u7ec8\u7aef\u8fd9\u4e1c\u897f&#xff0c;\u6572\u9519\u4e00\u6b21\u8bb0\u4f4f\u4e00\u6b21&#xff0c;\u6572\u591a\u4e86\u5c31\u6210\u4e86\u808c\u8089\u8bb0\u5fc6\u3002\u795d\u4f60\u7684 UDP \u9879\u76ee\u65e9\u65e5\u8dd1\u901a&#xff0c;\u4e5f\u795d\u4f60\u5728 lesson53 \u4e00\u8def\u987a\u98ce\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883&#xff1a;Ubuntu 22.04  g&#xff08;\u6587\u4e2d\u6240\u6709\u8f93\u51fa\u5747\u6765\u81ea\u6211\u7684\u771f\u5b9e\u7ec8\u7aef&#xff0c;\u975e\u7f16\u9020&#xff09; \u9002\u5408\u8c01&#xff1a;\u5728 IDE \u91cc\u70b9\u60ef\u4e86\u9f20\u6807\u3001\u4e00\u8fdb\u7ec8\u7aef\u5c31\u53d1\u61f5\u7684 C \u521d\u5b66\u8005 \u9605\u8bfb\u65b9\u5f0f&#xff1a;\u5efa\u8bae\u6536\u85cf\u3002\u547d\u4ee4\u4e0d\u7528\u80cc&#xff0c;\u7528\u5230\u65f6\u7ffb\u56de\u6765\u6284\u4e00\u904d&#xff0c;\u6284\u5341\u6b21\u5c31\u662f\u81ea\u5df1\u7684\u4e86\u5728 Linux \u4e0b\u505a C \u5f00\u53d1&#xff0c;\u8131\u79bb\u4e0d\u4e86\u4e0e\u6587\u4ef6\u548c\u76ee\u5f55\u6253\u4ea4\u9053\u3002\u5f88\u591a\u521d\u5b66\u8005\u5728 Windows \u7684 IDE \u91cc\u70b9\u9f20\u6807\u4e60\u60ef\u4e86&#xff0c;\u4e00\u8fdb\u9ed1\u4e4e<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-105793","post","type-post","status-publish","format-standard","hentry","category-server","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\u3011\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4 - \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\/105793.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux\u3011\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u73af\u5883&#xff1a;Ubuntu 22.04 g&#xff08;\u6587\u4e2d\u6240\u6709\u8f93\u51fa\u5747\u6765\u81ea\u6211\u7684\u771f\u5b9e\u7ec8\u7aef&#xff0c;\u975e\u7f16\u9020&#xff09; \u9002\u5408\u8c01&#xff1a;\u5728 IDE \u91cc\u70b9\u60ef\u4e86\u9f20\u6807\u3001\u4e00\u8fdb\u7ec8\u7aef\u5c31\u53d1\u61f5\u7684 C \u521d\u5b66\u8005 \u9605\u8bfb\u65b9\u5f0f&#xff1a;\u5efa\u8bae\u6536\u85cf\u3002\u547d\u4ee4\u4e0d\u7528\u80cc&#xff0c;\u7528\u5230\u65f6\u7ffb\u56de\u6765\u6284\u4e00\u904d&#xff0c;\u6284\u5341\u6b21\u5c31\u662f\u81ea\u5df1\u7684\u4e86\u5728 Linux \u4e0b\u505a C \u5f00\u53d1&#xff0c;\u8131\u79bb\u4e0d\u4e86\u4e0e\u6587\u4ef6\u548c\u76ee\u5f55\u6253\u4ea4\u9053\u3002\u5f88\u591a\u521d\u5b66\u8005\u5728 Windows \u7684 IDE \u91cc\u70b9\u9f20\u6807\u4e60\u60ef\u4e86&#xff0c;\u4e00\u8fdb\u9ed1\u4e4e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/105793.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-15T22:56:33+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"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\/105793.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/105793.html\",\"name\":\"\u3010Linux\u3011\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-15T22:56:33+00:00\",\"dateModified\":\"2026-09-15T22:56:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/105793.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/105793.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105793.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux\u3011\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4\"}]},{\"@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\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4 - \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\/105793.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux\u3011\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u73af\u5883&#xff1a;Ubuntu 22.04 g&#xff08;\u6587\u4e2d\u6240\u6709\u8f93\u51fa\u5747\u6765\u81ea\u6211\u7684\u771f\u5b9e\u7ec8\u7aef&#xff0c;\u975e\u7f16\u9020&#xff09; \u9002\u5408\u8c01&#xff1a;\u5728 IDE \u91cc\u70b9\u60ef\u4e86\u9f20\u6807\u3001\u4e00\u8fdb\u7ec8\u7aef\u5c31\u53d1\u61f5\u7684 C \u521d\u5b66\u8005 \u9605\u8bfb\u65b9\u5f0f&#xff1a;\u5efa\u8bae\u6536\u85cf\u3002\u547d\u4ee4\u4e0d\u7528\u80cc&#xff0c;\u7528\u5230\u65f6\u7ffb\u56de\u6765\u6284\u4e00\u904d&#xff0c;\u6284\u5341\u6b21\u5c31\u662f\u81ea\u5df1\u7684\u4e86\u5728 Linux \u4e0b\u505a C \u5f00\u53d1&#xff0c;\u8131\u79bb\u4e0d\u4e86\u4e0e\u6587\u4ef6\u548c\u76ee\u5f55\u6253\u4ea4\u9053\u3002\u5f88\u591a\u521d\u5b66\u8005\u5728 Windows \u7684 IDE \u91cc\u70b9\u9f20\u6807\u4e60\u60ef\u4e86&#xff0c;\u4e00\u8fdb\u9ed1\u4e4e","og_url":"https:\/\/www.wsisp.com\/helps\/105793.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-15T22:56:33+00:00","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\/105793.html","url":"https:\/\/www.wsisp.com\/helps\/105793.html","name":"\u3010Linux\u3011\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-15T22:56:33+00:00","dateModified":"2026-09-15T22:56:33+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/105793.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/105793.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/105793.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux\u3011\u4e09\u5341\u516d.Linux \u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u7ec8\u6781\u6307\u5357\uff1a\u4ece\u65b0\u624b\u5230\u719f\u7ec3\u8fd0\u7ef4"}]},{"@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\/105793","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=105793"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/105793\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=105793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=105793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=105793"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=105793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}