{"id":79953,"date":"2026-03-03T19:51:23","date_gmt":"2026-03-03T11:51:23","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/79953.html"},"modified":"2026-03-03T19:51:23","modified_gmt":"2026-03-03T11:51:23","slug":"shell%e5%85%89%e9%80%9f%e5%85%a5%e9%97%a8%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/79953.html","title":{"rendered":"shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0"},"content":{"rendered":"<h2><font color=\"blue\"><\/font>shell\u5b66\u4e60\u7b14\u8bb0-bash<\/h2>\n<ul>\n<li>\u5b66\u4e60\u89c6\u9891\u94fe\u63a5&#xff1a;\u301030\u5206\u949fShell\u5149\u901f\u5165\u95e8\u6559\u7a0b\u3011 https:\/\/www.bilibili.com\/video\/BV17m411U7cC\/?share_source&#061;copy_web&amp;vd_source&#061;fb850db820b823205dfea926dc8f484d<\/li>\n<li>github\u7b14\u8bb0\u5730\u5740&#xff1a;https:\/\/github.com\/anwei85\/study_note<\/li>\n<\/ul>\n<h3>\u4e00\u3001shell\u7b80\u4ecb<\/h3>\n<h4>1.shell\u57fa\u672c\u77e5\u8bc6<\/h4>\n<li>\n<p>shell\u7684\u5b9a\u4e49<br \/>\nshell\u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u89e3\u91ca\u5668\u3002<br \/>\n\u8d1f\u8d23\u63a5\u6536\u7528\u6237\u8f93\u5165\u7684\u547d\u4ee4&#xff0c;\u7136\u540e\u8c03\u7528\u64cd\u4f5c\u7cfb\u7edf\u7684\u5185\u6838\u53bb\u6267\u884c\u8fd9\u4e9b\u547d\u4ee4&#xff0c;\u518d\u628a\u6267\u884c\u7684\u7ed3\u679c\u8fd4\u56de\u7ed9\u7528\u6237\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115120-69a6cb38825ef.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<li>\n<p>shell\u7684\u5206\u7c7b&#xff1a;<br \/>\n\u901a\u5e38\u5206\u4e3a\u5982\u4e0b\u51e0\u79cd<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115120-69a6cb38c6d99.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n\u6b64\u5916&#xff0c;windows\u7cfb\u7edf\u4e0a\u4e5f\u6709\u5fae\u8f6f\u81ea\u5df1\u7684\u547d\u4ee4\u63d0\u793a\u7b26&#xff1a;power shell<\/p>\n<\/li>\n<li>\n<p>shell-bash\u73af\u5883<\/p>\n<li>WSL\u5b89\u88c5LINUX<\/li>\n<li>\u865a\u62df\u673a\u5b89\u88c5LINUX<\/li>\n<li>git\u53f3\u952ebash\u8fd0\u884c\u2013\u53ea\u80fd\u6267\u884c\u8f83\u4e3a\u7b80\u5355\u7684\u547d\u4ee4<\/li>\n<\/li>\n<li>\n<p>\u57fa\u672c\u547d\u4ee4<\/p>\n<li>cat \/etc\/shells \u67e5\u770b\u7cfb\u7edf\u7684\u6240\u6709shell\u7248\u672c<\/li>\n<li>echo $shell \u786e\u8ba4\u5f53\u524d\u7cfb\u7edf\u4f7f\u7528\u7684\u54ea\u4e2ashell\u7248\u672c<\/li>\n<p>\u5176\u4ed6\u5e38\u7528\u73af\u5883\u53d8\u91cf&#xff08;\u524d\u52a0echo\u548c$&#xff09;&#xff1a;<\/p>\n<p>home\u5b58\u50a8\u5f53\u524d\u7528\u6237\u7684\u5bb6\u76ee\u5f55<br \/>\npath\u5b58\u50a8\u7cfb\u7edf\u7684\u67e5\u627e\u8def\u5f84<\/p>\n<li>echo $0 \u6765\u67e5\u770b\u5f53\u524d\u6267\u884c\u811a\u672c\u7684\u540d\u79f0<\/li>\n<p>\u4e24\u8005\u4e0d\u540c&#xff0c;\u5f53\u5207\u6362\u5230\u5176\u4ed6shell\u7248\u672c\u65f6&#xff0c;\u7cfb\u7edf$shell\u4e0d\u4f1a\u53d1\u751f\u53d8\u5316&#xff0c;\u800c\u53e6\u4e00\u4e2a\u4f1a\u8ddf\u7740\u5207\u6362\u663e\u793a\u51fa\u7684\u7248\u672c<\/p>\n<p>\u76f4\u63a5\u8f93\u5165\u811a\u672c\u7684\u8def\u5f84\u5373\u53ef\u5207\u6362\u5230\u8be5\u7248\u672c&#xff0c;\u9000\u51fa\u8f93\u5165$exit<\/p>\n<\/li>\n<li>\n<p>\u57fa\u7840\u811a\u672c\u6587\u4ef6<\/p>\n<ul>\n<li>\u540e\u7f00\u4e00\u822c\u4e3a .sh&#xff0c;\u4f46\u53ef\u4ee5\u5199\u6210\u4efb\u4f55\u5176\u4ed6\u7684&#xff0c;\u751a\u81f3\u6ca1\u6709\u4e5f\u53ef\u4ee5<\/li>\n<li>\u7b2c\u4e00\u884c\u4e00\u822c\u4e3a#!\/bin\/bash&#xff0c;\u89e3\u91ca\u8fd9\u662f\u4ec0\u4e48\u89e3\u91ca\u5668&#xff0c;\u540e\u9762\u4e3a\u67e5\u5230\u7684\u89e3\u91ca\u5668\u7684\u8def\u5f84<\/li>\n<li>\u6587\u4ef6\u4e2d\u547d\u4ee4\u4f1a\u4f9d\u6b21\u6267\u884c<\/li>\n<\/ul>\n<li>\u5728\u547d\u4ee4\u884c\u4e2d&#xff0c;chmod &#043;x \u6587\u4ef6\u540d \u8d4b\u4e88\u6587\u4ef6\u53ef\u6267\u884c\u7684\u6743\u9650<\/li>\n<li>\u5728\u547d\u4ee4\u884c\u4e2d&#xff0c; .\/\u6587\u4ef6\u540d\u6216bash \u6587\u4ef6\u540d \u6267\u884c\u6587\u4ef6\n<p>bash\u6267\u884c\u4e0d\u9700\u8981\u6dfb\u52a0\u6743\u9650&#xff0c;.\/\u9700\u8981\u6dfb\u52a0\u6743\u9650<\/p>\n<\/li>\n<\/li>\n<li>\n<p>\u7279\u6b8a\u53d8\u91cf&#xff08;\u524d\u90fd\u6709$&#xff09;<br \/>\n#\u2014\u2014\u4f20\u9012\u7ed9\u811a\u672c\u6216\u51fd\u6570\u7684\u4f4d\u7f6e\u53c2\u6570\u7684\u4e2a\u6570<br \/>\n?\u2014\u2014\u4e0a\u4e00\u4e2a\u547d\u4ee4\u7684\u9000\u51fa\u72b6\u6001\u30020\u8868\u793a\u6ca1\u6709\u9519\u8bef&#xff0c;\u975e0\u503c\u8868\u793a\u6709\u9519\u8bef<br \/>\n*\u2014\u2014\u4f20\u9012\u7ed9\u811a\u672c\u6216\u51fd\u6570\u7684\u4f4d\u7f6e\u53c2\u6570&#xff0c;\u53cc\u5f15\u53f7\u5305\u56f4\u65f6\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53<br \/>\n&#064;\u2014\u2014\u4f20\u9012\u7ed9\u811a\u672c\u6216\u51fd\u6570\u7684\u4f4d\u7f6e\u53c2\u6570<br \/>\n&#xff08;\u4e24\u4e2a\u7f8e\u5143\u7b26\u53f7&#xff09;\u2014\u2014\u5f53\u524dshell\u8fdb\u7a0b\u7684\u8fdb\u7a0bid&#xff08;PID&#xff09;<br \/>\n0\u2014\u2014\u5f53\u524d\u811a\u672c\u7684\u540d\u79f0<br \/>\n1-n\u2014\u2014\u811a\u672c\u6216\u51fd\u6570\u7684\u4f4d\u7f6e\u53c2\u6570<\/p>\n<\/li>\n<h3>\u4e8c\u3001\u5b9e\u64cd\u6848\u4f8b<\/h3>\n<p>\u8fd0\u884c\u6587\u4ef6\u524d\u5148\u8fdb\u5165\u6587\u4ef6\u6240\u5904\u76ee\u5f55&#xff0c;\u5982cd \u201c\/d\/400 Tech stack\/440 Study Notes\/5\u3001Linux\/shell\u201d<\/p>\n<p>\u4f8b1\u2013hello .sh:<\/p>\n<p>#!\/bin\/bash<br \/>\necho &#034;Hello Wolrd &#034;<br \/>\n#\u8f93\u51fa\u5bf9\u5e94\u5185\u5bb9<br \/>\ndate<br \/>\n#\u8f93\u51fa\u65e5\u671f<br \/>\nwhoami<br \/>\n#\u8f93\u51fa\u7528\u6237\u540d<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115121-69a6cb3935cfc.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4f8b2\u2013game .sh&#xff1a;<\/p>\n<p>#!\/bin\/bash<br \/>\necho &#034;\u8bf7\u8f93\u5165\u60a8\u7684\u59d3\u540d&#xff1a;&#034;<br \/>\nread name<br \/>\n#\u8bfb\u53d6\u7528\u6237\u8f93\u5165<br \/>\necho &#034;\u60a8\u597d $name&#034;<br \/>\n#\u53d8\u91cf\u524d\u7528$\u7b26\u53f7<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115121-69a6cb395ce6b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4f8b3\u2013game .sh:<\/p>\n<p>\u53c2\u6570\u6765\u7ed9\u811a\u672c\u4f20\u9012\u4fe1\u606f&#xff0c;\u5e38\u89c1\u4e8e\u65e0\u6cd5\u4ea4\u4e92\u5f0f\u8f93\u5165\u7684\u60c5\u51b5\u4e0b<\/p>\n<p>\u53ef\u4ee5\u76f4\u63a5\u5728\u6267\u884c\u547d\u4ee4\u540e\u8f93\u5165\u503c&#xff0c;\u4e5f\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u5229\u7528export\u5b9a\u4e49\u73af\u5883\u53d8\u91cf\u6765\u8fdb\u884c\u8d4b\u503c<\/p>\n<p>\u4ec5\u6709\u6548\u4e00\u6b21\u5bf9\u8bdd\u6846&#xff0c;exit\u9000\u51fa\u91cd\u8fdb\u540e&#xff0c;\u8bbe\u5b9a\u7684\u53d8\u91cf\u5c31\u4f1a\u5931\u6548<br \/>\n\u5708\u51fa\u7684\u4e24\u4e2a\u6587\u4ef6\u5939\u90fd\u662f\u5b58\u653e\u73af\u5883\u53d8\u91cf\u7684&#xff0c;\u5982\u679c\u60f3\u7ee7\u7eed\u4f7f\u7528\u53d8\u91cf\u8bbe\u5b9a&#xff0c;\u53ef\u4ee5\u5c06\u6587\u4ef6\u653e\u7f6e.bashrc\u4e0b<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115121-69a6cb39742ce.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>#!\/bin\/bash<br \/>\necho &#034;\u8bf7\u8f93\u5165\u60a8\u7684\u59d3\u540d&#xff1a;&#034;<br \/>\n#read name<br \/>\n#\u8bfb\u53d6\u7528\u6237\u8f93\u5165<br \/>\nname&#061;$1<br \/>\nchannel&#061;$2<br \/>\necho &#034;\u60a8\u597d $name&#xff0c;\u6b22\u8fce\u6765\u5230$channel&#034;<br \/>\n#\u53d8\u91cf\u524d\u7528$\u7b26\u53f7<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115121-69a6cb398c1b3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>#!\/bin\/bash<br \/>\necho &#034;\u8bf7\u8f93\u5165\u60a8\u7684\u59d3\u540d&#xff1a;&#034;<br \/>\n#read name<br \/>\n#\u8bfb\u53d6\u7528\u6237\u8f93\u5165<br \/>\n#name&#061;$1<br \/>\n#channel&#061;$2<br \/>\necho &#034;\u60a8\u597d $name&#xff0c;\u6b22\u8fce\u6765\u5230$channel&#034;<br \/>\n#\u53d8\u91cf\u524d\u7528$\u7b26\u53f7<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115121-69a6cb39a3053.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4f8b4\u2013game .sh<br \/>\n\u52a0\u5165\u6b63\u786e\u63d0\u793a<\/p>\n<p>echo &#034;\u60a8\u597d $name&#xff0c;\u6b22\u8fce\u6765\u5230$channel&#034;<br \/>\n# \u53d8\u91cf\u524d\u7528$\u7b26\u53f7<br \/>\nnumber&#061;$(shuf -i 1-10 -n 1)<br \/>\n#i \u8303\u56f4,n \u4e2a\u6570;\u547d\u4ee4\u8d4b\u503c\u7ed9\u53d8\u91cf\u9700\u8981\u52a0$()<br \/>\necho $number<br \/>\necho &#034;\u8bf7\u8f93\u5165\u4e00\u4e2a1-10\u4e4b\u95f4\u7684\u6570\u5b57&#034;<br \/>\nread guess<br \/>\nif [ &#034;$guess&#034; -eq &#034;$number&#034; ]; then<br \/>\n#-eq \u662f\u76f8\u7b49\u7684\u610f\u601d<br \/>\n    echo &#034;\u731c\u5bf9\u4e86&#034;<br \/>\nfi<br \/>\n#\u53ef\u4ee5\u52a0[],[[]]\u6216(())&#xff1b;\u5206\u522b\u4e3a\u57fa\u672c&#xff0c;\u6269\u5c55\u548c\u6570\u5b66\u8868\u8fbe\u5f0f&#xff1b;\u4e09\u884c\u4e3a\u4e00\u4e2a\u5b8c\u6574\u7684\u6761\u4ef6\u5224\u65ad<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115121-69a6cb39c2ce2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u52a0\u5165\u9519\u8bef\u63d0\u793a<\/p>\n<p>#!\/bin\/bash<br \/>\necho &#034;\u60a8\u597d $name&#xff0c;\u6b22\u8fce\u6765\u5230$channel&#034;<br \/>\nnumber&#061;$(shuf -i 1-10 -n 1)<br \/>\necho $number<br \/>\necho &#034;\u8bf7\u8f93\u5165\u4e00\u4e2a1-10\u4e4b\u95f4\u7684\u6570\u5b57&#034;<br \/>\nread guess<br \/>\nif [ &#034;$guess&#034; -eq &#034;$number&#034; ]; then<br \/>\n    echo &#034;\u731c\u5bf9\u4e86&#034;<br \/>\nelse<br \/>\n    echo &#034;\u731c\u9519\u4e86&#034;<br \/>\nfi<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115121-69a6cb39d61bc.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u52a0\u5165\u8f85\u52a9\u63d0\u793a<\/p>\n<p>#!\/bin\/bash<br \/>\necho &#034;\u60a8\u597d $name&#xff0c;\u6b22\u8fce\u6765\u5230$channel&#034;<br \/>\nnumber&#061;$(shuf -i 1-10 -n 1)<br \/>\necho $number<br \/>\necho &#034;\u8bf7\u8f93\u5165\u4e00\u4e2a1-10\u4e4b\u95f4\u7684\u6570\u5b57&#034;<br \/>\nread guess<br \/>\nif [ &#034;$guess&#034; -eq &#034;$number&#034; ]; then<br \/>\n    echo &#034;\u731c\u5bf9\u4e86&#034;<br \/>\nelif [ &#034;$guess&#034; -lt &#034;$number&#034; ]; then<br \/>\n    echo &#034;\u731c\u5c0f\u4e86&#034;<br \/>\nelse<br \/>\n    echo &#034;\u731c\u5927\u4e86&#034;<br \/>\nfi<br \/>\n#-lt \u5c0f\u4e8e&#xff0c;-gt\u5927\u4e8e<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115121-69a6cb39e9e70.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u52a0\u5165\u5faa\u73af&#xff0c;\u8ba9\u6e38\u620f\u53ef\u4ee5\u591a\u8fd0\u884c\u51e0\u8f6e&#xff0c;\u53ea\u5230\u731c\u4e2d\u4e3a\u6b62<\/p>\n<p>for\u5faa\u73af\u2013\u904d\u5386\u5217\u8868\u548c\u6570\u7ec4&#xff1b;while\u5faa\u73af\u2013\u5728\u6761\u4ef6\u6210\u7acb\u7684\u60c5\u51b5\u4e0b\u4e00\u76f4\u6267\u884c<\/p>\n<p>#!\/bin\/bash<br \/>\necho &#034;\u60a8\u597d $name&#xff0c;\u6b22\u8fce\u6765\u5230$channel&#034;<br \/>\nnumber&#061;$(shuf -i 1-10 -n 1)<br \/>\necho $number<br \/>\nwhile [[ &#034;$guess&#034; -ne &#034;$number&#034; ]]<br \/>\ndo<br \/>\necho &#034;\u8bf7\u8f93\u5165\u4e00\u4e2a1-10\u4e4b\u95f4\u7684\u6570\u5b57&#034;<br \/>\nread guess<br \/>\nif [[ &#034;$guess&#034; -eq &#034;$number&#034; ]]; then<br \/>\n    echo &#034;\u731c\u5bf9\u4e86&#034;<br \/>\nelif [[ &#034;$guess&#034; -lt &#034;$number&#034; ]]; then<br \/>\n#-lt \u5c0f\u4e8e&#xff0c;-gt\u5927\u4e8e<br \/>\n    echo &#034;\u731c\u5c0f\u4e86&#034;<br \/>\nelse<br \/>\n    echo &#034;\u731c\u5927\u4e86&#034;<br \/>\nfi<br \/>\ndone<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115122-69a6cb3a15c1b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u52a0\u5165\u7528\u6237\u81ea\u4e3b\u9009\u62e9\u662f\u5426\u7ed3\u675f<\/p>\n<p>break \u7ed3\u675f\u5faa\u73af&#xff1b;continue \u8df3\u8fc7\u5f53\u524d\u5faa\u73af<\/p>\n<p>#!\/bin\/bash<br \/>\necho &#034;\u60a8\u597d $name&#xff0c;\u6b22\u8fce\u6765\u5230$channel&#034;<br \/>\nnumber&#061;$(shuf -i 1-10 -n 1)<br \/>\necho $number<br \/>\nwhile true<br \/>\ndo<br \/>\necho &#034;\u8bf7\u8f93\u5165\u4e00\u4e2a1-10\u4e4b\u95f4\u7684\u6570\u5b57&#034;<br \/>\nread guess<br \/>\nif [[ &#034;$guess&#034; -eq &#034;$number&#034; ]]; then<br \/>\n    echo &#034;\u731c\u5bf9\u4e86!\u662f\u5426\u7ee7\u7eed\u6e38\u73a9(y\/n):&#034;<br \/>\n    read choice<br \/>\n    if [[ &#034;$choice&#034; &#061; &#034;y&#034; ]] || [[ &#034;$choice&#034; &#061; &#034;Y&#034; ]];then<br \/>\n    # ||\u8868\u793a\u6216\u8005<br \/>\n        number&#061;$((RANDOM % 10 &#043; 1))<br \/>\n        echo $number<br \/>\n        #\u751f\u62101-10\u7684\u968f\u673a\u6570&#xff0c;\u4e0d\u52a01\u662f0-9<br \/>\n        continue<br \/>\n    else<br \/>\n        break<br \/>\n    fi<br \/>\nelif [[ &#034;$guess&#034; -lt &#034;$number&#034; ]]; then<br \/>\n#-lt \u5c0f\u4e8e&#xff0c;-gt\u5927\u4e8e&#xff1b;\u6bd4\u8f83\u6574\u6570\u7528-eq\u3002\u6bd4\u8f83\u5b57\u7b26\u4e32\u7528&#061;<br \/>\n    echo &#034;\u731c\u5c0f\u4e86&#034;<br \/>\nelse<br \/>\n    echo &#034;\u731c\u5927\u4e86&#034;<br \/>\nfi<br \/>\ndone<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115122-69a6cb3a2eee2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>shell\u5b66\u4e60\u7b14\u8bb0-bash<br \/>\n\u5b66\u4e60\u89c6\u9891\u94fe\u63a5&#xff1a;\u301030\u5206\u949fShell\u5149\u901f\u5165\u95e8\u6559\u7a0b\u3011 https:\/\/www.bilibili.com\/video\/BV17m411U7cC\/?share_sourcecopy_web&amp;vd_sourcefb850db820b823205dfea926dc8f484dgithub\u7b14\u8bb0\u5730\u5740&#xff1a;https:\/\/github.com\/anwei85\/study_note<br \/>\n\u4e00\u3001shell\u7b80\u4ecb<br \/>\n1.shell\u57fa\u672c\u77e5\u8bc6shell\u7684\u5b9a\u4e49<\/p>\n","protected":false},"author":2,"featured_media":79941,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[352,92,58],"topic":[],"class_list":["post-79953","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-bash","tag-github","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0 - \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\/79953.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"shell\u5b66\u4e60\u7b14\u8bb0-bash \u5b66\u4e60\u89c6\u9891\u94fe\u63a5&#xff1a;\u301030\u5206\u949fShell\u5149\u901f\u5165\u95e8\u6559\u7a0b\u3011 https:\/\/www.bilibili.com\/video\/BV17m411U7cC\/?share_sourcecopy_web&amp;vd_sourcefb850db820b823205dfea926dc8f484dgithub\u7b14\u8bb0\u5730\u5740&#xff1a;https:\/\/github.com\/anwei85\/study_note \u4e00\u3001shell\u7b80\u4ecb 1.shell\u57fa\u672c\u77e5\u8bc6shell\u7684\u5b9a\u4e49\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/79953.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-03T11:51:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115120-69a6cb38825ef.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\/79953.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/79953.html\",\"name\":\"shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-03-03T11:51:23+00:00\",\"dateModified\":\"2026-03-03T11:51:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/79953.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/79953.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/79953.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0\"}]},{\"@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":"shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0 - \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\/79953.html","og_locale":"zh_CN","og_type":"article","og_title":"shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"shell\u5b66\u4e60\u7b14\u8bb0-bash \u5b66\u4e60\u89c6\u9891\u94fe\u63a5&#xff1a;\u301030\u5206\u949fShell\u5149\u901f\u5165\u95e8\u6559\u7a0b\u3011 https:\/\/www.bilibili.com\/video\/BV17m411U7cC\/?share_sourcecopy_web&amp;vd_sourcefb850db820b823205dfea926dc8f484dgithub\u7b14\u8bb0\u5730\u5740&#xff1a;https:\/\/github.com\/anwei85\/study_note \u4e00\u3001shell\u7b80\u4ecb 1.shell\u57fa\u672c\u77e5\u8bc6shell\u7684\u5b9a\u4e49","og_url":"https:\/\/www.wsisp.com\/helps\/79953.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-03-03T11:51:23+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260303115120-69a6cb38825ef.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\/79953.html","url":"https:\/\/www.wsisp.com\/helps\/79953.html","name":"shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-03-03T11:51:23+00:00","dateModified":"2026-03-03T11:51:23+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/79953.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/79953.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/79953.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"shell\u5149\u901f\u5165\u95e8\u7b14\u8bb0"}]},{"@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\/79953","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=79953"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/79953\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/79941"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=79953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=79953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=79953"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=79953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}