{"id":177818,"date":"2020-05-04T11:24:19","date_gmt":"2020-05-04T03:24:19","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=177818"},"modified":"2020-04-23T10:27:24","modified_gmt":"2020-04-23T02:27:24","slug":"12-linux-shell","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/12-linux-shell.html","title":{"rendered":"\u4ecb\u7ecd12\u4e2a\u4f18\u79c0\u7684\u514d\u8d39\u5f00\u6e90Linux Shell"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nLinux\u4e3a\u9ad8\u7ea7\u7528\u6237\u63d0\u4f9b\u4e86\u4e00\u4e9b\u6700\u597d\u7684\u5f00\u6e90shell\uff0c\u6211\u4eec\u5192\u6627\u5730\u4e3aLinux\u7528\u6237\u5217\u51fa\u4e86\u4e00\u4e9b\u6700\u597d\u7684\u514d\u8d39\u5f00\u6e90shell\u3002\u8bf7\u4ed4\u7ec6\u9605\u8bfb\u672c\u6587\uff0c\u627e\u51fa\u6700\u9002\u5408\u60a8\u7684Linux shell\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u81ea\u4ece70\u5e74\u4ee3Unix\u7cfb\u7edf\u8bde\u751f\u4ee5\u6765\uff0c\u5b83\u5c31\u4e00\u76f4\u5438\u5f15\u7740\u5168\u4e16\u754c\u7684\u76ee\u5149\u3002\u5e2e\u52a9Linux\u548cBSD\u53d1\u884c\u7248\u786e\u4fdd\u5176\u5f53\u524d\u5730\u4f4d\u7684\u57fa\u672c\u7279\u6027\u4e4b\u4e00\u662fLinux shell\u3002\u7531\u4e8e\u5176\u5f3a\u5927\u7684\u529f\u80fd\u548c\u591a\u6837\u7684\u5e94\u7528\u7a0b\u5e8f\uff0cshell\u662f\u8bb8\u591aLinux\u7231\u597d\u8005\u7684\u5fc5\u5907\u5de5\u5177\u4e4b\u4e00\u3002\u5b83\u662f\u64cd\u4f5c\u7cfb\u7edf\u7684\u547d\u4ee4\u884c\u63a5\u53e3\uff0c\u5141\u8bb8\u60a8\u6839\u636e\u81ea\u5df1\u7684\u6761\u4ef6\u6267\u884c\u4efb\u4f55\u7c7b\u578b\u7684\u64cd\u4f5c\u3002\u6b64\u5916\uff0cLinux shell\u4e0d\u4ec5\u662f\u4e00\u4e2a\u63a5\u53e3\uff0c\u800c\u4e14\u662f\u4e00\u79cd\u5177\u6709\u81ea\u5df1\u7684\u8bed\u6cd5\u548c\u8bed\u4e49\u96c6\u7684\u6210\u719f\u811a\u672c\u8bed\u8a00\u3002<\/p>\n

\u5e38\u7528\u7684Linux shell<\/strong><\/div>\n

Linux\u4e3a\u9ad8\u7ea7\u7528\u6237\u63d0\u4f9b\u4e86\u4e00\u4e9b\u6700\u597d\u7684\u5f00\u6e90shell\uff0c\u8fd9\u4e9b\u7528\u6237\u603b\u662f\u5e0c\u671b\u4e3a\u81ea\u5df1\u7684\u6b66\u5668\u5e93\u6dfb\u52a0\u65b0\u7684\u5de5\u5177\u5305\u3002\u8fd9\u53cd\u8fc7\u6765\u53c8\u4f7f\u8bb8\u591a\u65e5\u5e38\u7528\u6237\u5f88\u96be\u9009\u62e9\u7279\u5b9a\u7684shell\u3002\u6211\u4eec\u5192\u6627\u5730\u4e3aLinux\u7528\u6237\u5217\u51fa\u4e86\u4e00\u4e9b\u6700\u597d\u7684\u514d\u8d39\u5f00\u6e90shell\u3002\u8bf7\u4ed4\u7ec6\u9605\u8bfb\u672c\u6587\uff0c\u627e\u51fa\u6700\u9002\u5408\u60a8\u7684Linux shell\u3002<\/p>\n

1. sh Shell<\/strong><\/span><\/div>\n

Bourne Shell\u6216\u201csh\u201d\u662f\u5386\u53f2\u60a0\u4e45\u7684Unix\u64cd\u4f5c\u7cfb\u7edf\u5fe0\u7b2c\u4e00\u4e2a\u6d41\u884c\u7684 Shell\u3002sh \u662f UNIX \u4e0a\u7684\u6807\u51c6 shell\uff0c\u5b83\u7684\u521b\u5efa\u8005Stephen Bourne\u4e8e1977\u5e74\u5728AT&T\u8d1d\u5c14\u5b9e\u9a8c\u5ba4\u5f00\u53d1\u4e86\u5b83\uff0c\u81ea\u90a3\u65f6\u4ee5\u6765\uff0c\u5b83\u5df2\u968f\u5927\u591a\u6570\u65e9\u671f\u7684Unix\u7cfb\u7edf\u4e00\u8d77\u63d0\u4f9b\u3002Bourne Shell\u4ece\u5b83\u4f7f\u7528\u7684\u811a\u672c\u6269\u5c55\u540d\u4e2d\u83b7\u5f97\u4e86\u7b80\u77ed\u7684\u5f62\u5f0f\uff0c\u5b83\u8981\u6c42\u7528\u6237\u4ee5sh\u7ed3\u675f\u811a\u672c\u540d\u3002\u5b83\u4e3a\u8bb8\u591a\u6d41\u884c\u7684\u672a\u6765Shell\u8bbe\u7f6e\u4e86\u6807\u51c6\uff0c\u5305\u62ec\u91cd\u5b9a\u5411\uff0c\u811a\u672c\u529f\u80fd\u548c\u5f3a\u5927\u7684\u8bed\u8a00\u6784\u9020\u3002<\/p>\n

\"\"<\/p>\n

Bourne Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Bourne Shell\u7684\u9ed8\u8ba4Shell\u63d0\u793a\u7b26\u662f$\u7b26\u53f7\uff0c\u5b83\u662f\u7b2c\u4e00\u4e2a\u4f7f\u7528\u6b64\u5b57\u7b26\u4f5c\u4e3a\u63d0\u793a\u7b26\u7684Shell\u3002<\/p>\n

\u5b83\u5177\u6709\u5bf9\u8f93\u5165\u8f93\u51fa\u91cd\u5b9a\u5411\uff0cUnicode\uff0c\u6d41\u91cd\u5b9a\u5411\uff0c\u6279\u5904\u7406\u811a\u672c\u7b49\u7684\u5185\u7f6e\u652f\u6301\u3002<\/p>\n

\u5c3d\u7ba1\u6700\u521d\u76841977\u5e74\u7248\u672c\u7684shell\u662f\u79c1\u6709\u7684\uff0c\u4f46\u5b83\u5df2\u7ecf\u516c\u5f00\u63d0\u4f9b\u4e86\u6e90\u4ee3\u7801\u3002<\/p>\n

sh shell\u662f\u9ad8\u5ea6\u53ef\u914d\u7f6e\u7684\uff0c\u53ef\u4ee5\u8fdb\u884c\u4fee\u6539\u4ee5\u8f7b\u677e\u5339\u914d\u4e0d\u540c\u7684\u7cfb\u7edf\u6807\u51c6\u3002<\/p>\n

2. Bash Shell<\/strong><\/span><\/div>\n

Bash\u88ab\u5e7f\u6cdb\u79f0\u4e3aBourne Again Shell\uff0c\u5b83\u53ef\u80fd\u662f\u73b0\u4ee3Unix\u673a\u5668\u4e0a\u4f7f\u7528\u6700\u591a\u7684Linux Shell\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u6807\u51c6Linux\u53d1\u884c\u7248(\u4f8b\u5982Ubuntu\u6216Arch)\uff0c\u5219\u60a8\u4f7f\u7528\u7684\u9ed8\u8ba4Shell\u662fBash Shell\u3002\u8fd9\u79cd\u5f00\u6e90Linux shell\u4ee5\u5176\u5f3a\u5927\u7684\u529f\u80fd\u96c6\u548c\u53ef\u7528\u6027\u800c\u5728\u793e\u533a\u4e2d\u5e7f\u4e3a\u4eba\u77e5\u3002\u56e0\u6b64\uff0c\u5927\u591a\u6570Linux\u7528\u6237\u5728\u4e00\u751f\u4e2d\u7684\u67d0\u4e00\u65f6\u523b\u90fd\u8fd0\u884cBash\u3002<\/p>\n

Bash Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Bash\u63d0\u4f9b\u7684\u547d\u4ee4\u884c\u7f16\u8f91\u529f\u80fd\u975e\u5e38\u51fa\u8272\uff0c\u5e76\u4e14\u63d0\u4f9b\u4e86\u65e0\u9650\u7684\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u3002<\/p>\n

Bash\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684shell\u51fd\u6570\uff0c\u522b\u540d\uff0c\u4f5c\u4e1a\u63a7\u5236\u673a\u5236\uff0c\u8f93\u5165\u8f93\u51fa\u91cd\u5b9a\u5411\uff0cISO 8061\u652f\u6301\u4ee5\u53caUnicode\u652f\u6301\u3002<\/p>\n

\u8fd9\u4e2a\u5f00\u6e90Linux shell\u4e3a\u547d\u4ee4\u540d\u3001\u8def\u5f84\u3001\u901a\u914d\u7b26\u63d0\u4f9b\u4e86\u81ea\u52a8\u5b8c\u6210\u652f\u6301\uff0c\u5e76\u5141\u8bb8\u5728\u6587\u672c\u9ad8\u4eae\u663e\u793a\u7684\u540c\u65f6\u663e\u793a\u5f69\u8272\u76ee\u5f55\u6e05\u5355\u3002<\/p>\n

Bash\u53ef\u4ee5\u6267\u884c\u4ece2\u523064\u7684\u4efb\u4f55\u57fa\u6570\u7684\u6574\u6570\u8fd0\u7b97\uff0c\u5e76\u5141\u8bb8\u5177\u6709\u65e0\u9650\u5927\u5c0f\u7684\u7d22\u5f15\u6570\u7ec4\u3002<\/p>\n

3. C Shell<\/strong><\/span><\/div>\n

C shell\u6216\u201ccsh\u201d\u662f\u6700\u53e4\u8001\u7684\u5f00\u6e90Unix shell\u4e4b\u4e00\u3002\u5b83\u662f\u7531UCB\u5f53\u65f6\u7684\u7814\u7a76\u751fBill Joy\u572870\u5e74\u4ee3\u5f00\u53d1\u7684\u3002\u4ece\u90a3\u65f6\u8d77\uff0ccsh\u9644\u5e26\u4e86\u8bb8\u591aUnix\u53d8\u4f53\uff0c\u5c24\u5176\u662f\u5404\u79cdBSD\u3002\u5b83\u4e3a\u89e3\u91ca\u5668\u5408\u5e76\u4e86\u7c7b\u4f3c\u4e8eC\u7684\u8bed\u6cd5\uff0c\u7531\u4e8e\u539f\u59cb\u7684Unix\u7cfb\u7edf\u548c\u73b0\u4ee3Linux\u5185\u6838\u5927\u90e8\u5206\u90fd\u662f\u7528C\/C++\u7f16\u5199\u7684\uff0c\u56e0\u6b64\u5bf9\u8bb8\u591a\u4eba\u6765\u8bf4\u90fd\u662f\u6709\u5e2e\u52a9\u7684\u3002<\/p>\n

C Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

C Shell\u63d0\u4f9b\u4e86\u521b\u65b0\u7684\u5386\u53f2\u8bb0\u5f55\u673a\u5236\uff0c\u4f5c\u4e1a\u63a7\u5236\u8fc7\u7a0b\uff0c\u4ea4\u4e92\u5f0f\u6587\u4ef6\u540d\u548c\u7528\u6237\u540d\u8865\u5168\u4ee5\u53ca\u7c7b\u4f3cC\u7684\u8bed\u6cd5\u3002<\/p>\n

\u5b83\u5141\u8bb8\u9ad8\u7ea7\u7528\u6237\u5c06\u5176\u7528\u4f5c\u4ea4\u4e92\u5f0f\u767b\u5f55Shell\u6216Shell\u811a\u672c\u7684\u547d\u4ee4\u5904\u7406\u5668\u3002<\/p>\n

Linux C Shell\u4f7f\u7528\u7684\u9ed8\u8ba4Shell\u63d0\u793a\u7b26\u662f\u201c%\u201d\u7b26\u53f7\uff0c\u4e0e\u8bb8\u591aBash\u7528\u6237\u719f\u6089\u7684\u201c $\u201d\u7b26\u53f7\u76f8\u53cd\u3002<\/p>\n

C Shell\u4f7f\u7528\u6237\u80fd\u591f\u641c\u7d22\u548c\u66ff\u6362\u53d8\u91cf\u66ff\u6362\u4ee5\u53ca\u57fa\u4e8e\u901a\u914d\u7b26\u7684\u5339\u914d\u6a21\u5f0f\u3002<\/p>\n

4. Korn Shell<\/strong><\/span><\/div>\n

Korn Shell\u6216ksh\u53ef\u4ee5\u8bf4\u662f\u5f53\u4ecaLinux\u6700\u53d7\u6b22\u8fce\u7684\u5f00\u6e90Shell\u4e4b\u4e00\u3002\u5b83\u662f\u7531David Korn\u5728\u4f20\u5947\u7684\u8d1d\u5c14\u5b9e\u9a8c\u5ba4\u5f00\u53d1\u7684\uff0c\u4ed6\u4eceC Shell\u7684\u4ea4\u4e92\u6027\u548cBash Shell\u7684\u4e92\u52a8\u5f0f\u4e2d\u83b7\u5f97\u4e86\u542f\u53d1\u3002\u7531\u4e8e\u5176\u5148\u8fdb\u7684\u529f\u80fd\uff0c\u5305\u62ec\u9ad8\u7ea7\u4f5c\u4e1a\u63a7\u5236\uff0c\u547d\u4ee4\u522b\u540d\uff0c\u6d6e\u70b9\u7b97\u672f\u4ee5\u53ca\u8bb8\u591a\u5176\u4ed6\u529f\u80fd\uff0c\u81ea\u6210\u7acb\u4e4b\u521d\u4ee5\u6765\uff0cKorn Shell\u5c31\u5df2\u7ecf\u83b7\u5f97\u4e86\u6781\u5927\u7684\u6b22\u8fce\u3002<\/p>\n

Korn Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Korn Shell\u5141\u8bb8\u7528\u6237\u4f7f\u7528Ctrl + Z\u7ec8\u6b62\u5f53\u524d\u4f5c\u4e1a\uff0c\u5e76\u4f7f\u7528\u547d\u4ee4fg\u548cbg\u5c06\u5176\u7f6e\u4e8e\u524d\u53f0\u6216\u540e\u53f0\u3002<\/p>\n

\u5b83\u53ef\u7528\u4e8e\u76f4\u63a5\u5c06Shell\u7a0b\u5e8f\u4ee3\u7801\u5b58\u50a8\u5728\u5185\u5b58\u4e2d\uff0c\u4ece\u800c\u63d0\u9ad8\u7f16\u7a0b\u80fd\u529b\u548c\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n

ksh\u63d0\u4f9b\u4e86\u9ad8\u7ea7\u547d\u4ee4\u884c\u7f16\u8f91\uff0c\u7528\u6237\u53ef\u4ee5\u5728\u5176\u4e2d\u76f4\u63a5\u4ece\u5176Shell\u4f7f\u7528vi\u6216Emacs\u98ce\u683c\u7684\u7f16\u8f91\u547d\u4ee4\u3002<\/p>\n

Korn Shell\u811a\u672c\u901a\u5e38\u6bd4Bourne Shell\u811a\u672c\u66f4\u5feb\uff0c\u5e76\u63d0\u4f9b\u9ad8\u7ea7I\/O\u529f\u80fd\u4ee5\u53ca\u663e\u7740\u7684\u5b89\u5168\u6027\u673a\u5236\u3002<\/p>\n

5. Zsh Shell<\/strong><\/span><\/div>\n

Zsh Shell\u662f\u5177\u6709\u8bb8\u591a\u5f3a\u5927\u529f\u80fd\u7684\u521b\u65b0\u578b\u73b0\u4ee3Linux Shell\u3002\u5b83\u662f\u5728Bash\u4e4b\u4e0a\u5f00\u53d1\u7684\uff0c\u5e76\u5728\u6709\u6548\u7684\u547d\u4ee4\u89e3\u91ca\u5668\u65c1\u8fb9\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u767b\u5f55Shell\u3002Zsh\u4ee5\u5176\u6027\u80fd\u800c\u95fb\u540d\uff0c\u5b83\u5728\u8bb8\u591a\u65b9\u9762\u90fd\u5927\u5927\u6539\u5584\u4e86Linux\u7684\u8bb8\u591a\u5f00\u6e90Shell\u3002\u5b83\u8fd8\u501f\u9274\u4e8690\u5e74\u4ee3\u5176\u4ed6\u6d41\u884cShell\u7684\u5143\u7d20\uff0c\u5305\u62ecKsh\u548cTcshShell\u3002\u5982\u679c\u60a8\u662fLinux\u4e13\u5bb6\uff0c\u6b63\u5728\u5bfb\u627e\u9ad8\u7ea7Linux Shell\uff0c\u8bf7\u5c1d\u8bd5Zsh\u3002<\/p>\n

Zsh Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Zsh\u7684\u81ea\u52a8\u5b8c\u6210\u529f\u80fd\u975e\u5e38\u667a\u80fd\uff0c\u5e76\u4e14\u652f\u6301\u6587\u4ef6\u548c\u8def\u5f84\u7684\u9ad8\u5ea6\u4ea4\u4e92\u5f0f\u81ea\u52a8\u5b8c\u6210\u3002<\/p>\n

\u8fd9\u4e2a\u5f00\u6e90Unix shell\u7684\u5386\u53f2\u8bb0\u5f55\u5171\u4eab\u673a\u5236\u975e\u5e38\u5e9e\u5927\uff0c\u5141\u8bb8\u540c\u65f6\u8fd0\u884c\u7684\u8bb8\u591a\u4e0d\u540c\u7ec8\u7aef\u5b9e\u4f8b\u7684\u5171\u4eab\u5386\u53f2\u8bb0\u5f55\u3002<\/p>\n

\u7528\u6237\u53ef\u4ee5\u4ece\u5176\u6d41\u884c\u7684\uff0c\u793e\u533a\u9a71\u52a8\u7684\u6846\u67b6oh-my-zsh\u4e2d\u9009\u62e9400\u591a\u4e2a\u63d2\u4ef6\u548c200\u591a\u4e2a\u4e3b\u9898\u3002<\/p>\n

Zsh\u8fd8\u652f\u6301vi\u6a21\u5f0f\uff0c\u667a\u80fd\u8f6c\u4e49\uff0c\u9012\u5f52\u904d\u5386\uff0c\u5c06\u8f93\u51fa\u4f20\u9012\u5230\u4e34\u65f6\u6587\u4ef6\uff0c\u62fc\u5199\u66f4\u6b63\u4ee5\u53ca\u8bb8\u591a\u5176\u4ed6\u4ea4\u4e92\u5f0f\u529f\u80fd\u3002<\/p>\n

6. Tcsh Shell<\/strong><\/span><\/div>\n

Tcsh shell\u662fC shell\u7684\u5347\u7ea7\u7248\u672c\uff0c\u5b83\u63d0\u4f9b\u53ef\u7f16\u7a0b\u547d\u4ee4\u5b8c\u6210\u548c\u547d\u4ee4\u884c\u7f16\u8f91\u4f5c\u4e3a\u5176\u5173\u952e\u529f\u80fd\u3002\u5b83\u4e0eCsh Shell\u5b8c\u5168\u517c\u5bb9\uff0c\u53ef\u4ee5\u7528\u4f5c\u4ea4\u4e92\u5f0f\u767b\u5f55Shell\u548cShell\u811a\u672c\u5904\u7406\u5668\u3002Tcsh\u5e26\u6709\u529f\u80fd\u5f3a\u5927\u7684\u547d\u4ee4\u884c\u7f16\u8f91\u5668\uff0c\u73b0\u4ee3\u5316\u7684\u5386\u53f2\u8bb0\u5f55\u673a\u5236\uff0c\u53ef\u7f16\u7a0b\u7684\u5355\u8bcd\u8865\u5168\uff0c\u4f5c\u4e1a\u63a7\u5236\uff0c\u62fc\u5199\u68c0\u67e5\u652f\u6301\u4ee5\u53ca\u7c7b\u4f3c\u4e8eC\u7684\u8bed\u6cd5\uff0c\u540e\u8ddfCsh\u3002\u8be5Unix shell\u6700\u9002\u5408\u9ad8\u7ea7\u7a0b\u5e8f\u5458\u3002<\/p>\n

Tcsh Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Tcsh\u5185\u7f6e\u4e86\u5bf9\u6587\u4ef6\u548c\u53d8\u91cf\u7684\u81ea\u52a8\u5b8c\u6210\u4ee5\u53ca\u53ef\u7f16\u7a0b\u5b8c\u6210\u548c\u522b\u540d\u53c2\u6570\u9009\u62e9\u5668\u7684\u652f\u6301\u3002<\/p>\n

\u5f53\u5728\u7ec8\u7aef\u4e0a\u8fd0\u884cshell\u811a\u672c\u65f6\uff0c\u5b83\u5141\u8bb8\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7528\u6237\u5408\u5e76\u901a\u914d\u7b26\u4ee5\u63d0\u9ad8\u7075\u6d3b\u6027\u3002<\/p>\n

\u8be5Linux shell\u7684\u9884\u6784\u5efawhere\u547d\u4ee4\u7684\u4f5c\u7528\u7c7b\u4f3c\u4e8eBash\u4e2d\u7684which\u547d\u4ee4\uff0c\u4f46\u663e\u793a$PATH\u76ee\u5f55\u4e2d\u6307\u5b9a\u7684\u76ee\u6807\u7684\u6bcf\u4e2a\u4f4d\u7f6e\u3002<\/p>\n

Tcsh\u662fFreeBSD\u53ca\u5176\u540e\u4ee3(\u4f8b\u5982DragonFly BSD\u548cDesktopBSD)\u7684\u9ed8\u8ba4\u547d\u4ee4\u884c\u89e3\u91ca\u5668\u3002<\/p>\n

7. Fish Shell<\/strong><\/span><\/div>\n

Fish Shell\u662f\u4e00\u79cd\u53cb\u597d\u7684\u4ea4\u4e92\u5f0fUnix Shell\uff0c\u65e8\u5728\u66ff\u4ee3Linux\u65e9\u671f\u7684\u5f00\u6e90Shell\u3002\u9664Windows\u64cd\u4f5c\u7cfb\u7edf\u5916\uff0c\u6bcf\u4e2aLinux\u548cBSD\u53d1\u884c\u7248\u5747\u63d0\u4f9b\u6b64\u529f\u80fd\u3002Fish\u63d0\u4f9b\u4e86\u4e00\u7ec4\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u4f7f\u60a8\u66f4\u5bb9\u6613\u53d1\u73b0\uff0c\u8bb0\u4f4f\u548c\u4f7f\u7528\u8ba1\u7b97\u673a\u4e0a\u4ee4\u4eba\u5174\u594b\u7684Linux\u547d\u4ee4\u3002\u5982\u679c\u60a8\u6b63\u5728\u5bfb\u627eLinux\u684c\u9762\u7684\u667a\u80fd\u547d\u4ee4\u884cShell\uff0cFish\u5f53\u7136\u503c\u5f97\u4e00\u8bd5\u3002<\/p>\n

Fish Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Fish\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684\u81ea\u52a8\u5efa\u8bae\u529f\u80fd\uff0c\u5373\u6839\u636e\u547d\u4ee4\u884c\u5386\u53f2\u548c\u5f53\u524d\u76ee\u5f55\u8fdb\u884c\u641c\u7d22\u3002<\/p>\n

\u5176\u529f\u80fd\u4e30\u5bcc\u7684Tav\u5b8c\u6210\u529f\u80fd\u5141\u8bb8\u7528\u6237\u4f7f\u7528\u901a\u914d\u7b26\u548c\u5927\u62ec\u53f7\u6269\u5c55\u6765\u6269\u5c55\u6587\u4ef6\u8def\u5f84\uff0c\u53d8\u91cf\u548c\u8bb8\u591a\u7279\u5b9a\u4e8e\u547d\u4ee4\u7684\u5b8c\u6210\u3002<\/p>\n

Fish\u5185\u7f6e\u4e86\u5bf924\u4f4d\u771f\u5f69\u8272\u7684\u652f\u6301\uff0c\u4f7f\u60a8\u7684\u7ec8\u7aef\u4f1a\u8bdd\u66f4\u52a0\u4e30\u5bcc\u591a\u5f69\u548c\u66f4\u5177\u5438\u5f15\u529b\u3002<\/p>\n

\u5bf9\u4e8e\u5bfb\u6c42\u5f00\u7bb1\u5373\u7528\u4e14\u65e0\u9700\u914d\u7f6e\u7684\u5f00\u6e90shell\u7684\u4eba\u4eec\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u4e2a\u5f88\u597d\u7684shell\u3002<\/p>\n

8. Ion Shell<\/strong><\/span><\/div>\n

Ion Shell\u662f\u4e00\u4e2a\u4ee4\u4eba\u7740\u8ff7\u7684\u73b0\u4ee3Shell\uff0c\u5b83\u5177\u6709\u7b80\u5355\u4f46\u529f\u80fd\u5f3a\u5927\u7684\u8bed\u6cd5\uff0c\u5e76\u663e\u7740\u63d0\u9ad8\u4e86\u6027\u80fd\u3002\u5b83\u662f\u4f7f\u7528Rust\u7f16\u7a0b\u8bed\u8a00\u7f16\u5199\u7684\uff0c\u56e0\u6b64\u5b83\u4e0d\u6613\u53d7\u5230\u8bb8\u591aBash\u7528\u6237\u9047\u5230\u7684\u5e38\u89c1\u201c ShellShcok\u201d\u95ee\u9898\u7684\u5f71\u54cd\u3002Ion\u4ece\u6d41\u884c\u7684Shell\u4e2d\u501f\u9274\u4e86\u8bb8\u591a\u8bbe\u8ba1\u5143\u7d20\uff0c\u4f8b\u5982Bash\uff0cFish\u548cOil\u3002\u56e0\u6b64\uff0c\u65e0\u9700\u82b1\u8d39\u592a\u591a\u65f6\u95f4\u5373\u53ef\u542f\u52a8\u5e76\u8fd0\u884c\u6b64\u51fa\u8272\u7684shell\u3002<\/p>\n

Ion Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Ion Shell\u6bd4Dash\u5feb\uff0c\u800cDash\u672c\u8eab\u6bd4\u5f53\u4eca\u5927\u591a\u6570Linux\u673a\u5668\u4f7f\u7528\u7684\u6807\u51c6Bash Shell\u5feb\u56db\u500d\u3002<\/p>\n

\u7531\u4e8e\u662f\u7528Rust\u7f16\u5199\u7684\uff0c\u6240\u4ee5Ion\u63d0\u4f9b\u4e86\u6bd4\u4f20\u7edf\u7684\u57fa\u4e8eC\/C++\u7684Unix\u547d\u4ee4\u884cShell\u66f4\u9ad8\u7684\u5185\u5b58\u5b89\u5168\u6027\u3002<\/p>\n

Ion\u5177\u6709\u5bf9\u5b57\u7b26\u4e32\uff0c\u6570\u7ec4\uff0cglob\uff0c\u5927\u62ec\u53f7(\u8303\u56f4\uff0c\u6392\u5217\uff0c\u5d4c\u5957\u5927\u62ec\u53f7)\uff0c\u7b97\u672f\u548c\u8fc7\u7a0b\u7684\u5185\u7f6e\u6269\u5c55\u652f\u6301\u3002<\/p>\n

\u5b83\u7b80\u5355\uff0c\u5e72\u51c0\u548c\u7b80\u6d01\u7684\u8bbe\u8ba1\u4f7f\u5176\u76f8\u5bf9\u6613\u4e8e\u4f7f\u7528\uff0c\u5e76\u5141\u8bb8\u7528\u6237\u5c06shell\u7f16\u8bd1\u4e3a\u9759\u6001\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n

9. Dash shell<\/strong><\/span><\/div>\n

Dash shell\u662fDebian Almquist shell(Dash)\u7684\u7f29\u5199\uff0c\u5e76\u4e14\u662fDebian\u64cd\u4f5c\u7cfb\u7edf\u7684\u9ed8\u8ba4\u547d\u4ee4\u884c\u89e3\u91ca\u5668\u3002\u5b83\u6bd4\u6807\u51c6\u7684GNU Bash shell\u5c0f\u5f97\u591a\uff0c\u4f46\u4ecd\u7136\u4ee5POSIX\u517c\u5bb9\u4e3a\u76ee\u6807\u3002Dash\u5728\u79fb\u690d\u5230Linux\u751f\u6001\u7cfb\u7edf\u4e4b\u524d\u5df2\u7ecf\u4eceNetBSD\u7248\u672c\u7684ash(Almquist SHell)\u884d\u751f\u800c\u6765\uff0c\u5e76\u4e14\u6bd4\u4f20\u7edf\u7684Unix shell\u5177\u6709\u663e\u8457\u7684\u6027\u80fd\u63d0\u5347\u3002Dash\u6bd4\u5927\u591a\u6570Shell\u66f4\u5feb\uff0c\u5e76\u4e14\u9700\u8981\u66f4\u5c11\u7684\u7a7a\u95f4\u548c\u66f4\u5c11\u7684\u5e93\u3002<\/p>\n

Dash shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Dash\u662fLinux\u6700\u5feb\u7684\u5f00\u6e90Shell\u4e4b\u4e00\uff0c\u5176\u65f6\u949f\u901f\u5ea6\u51e0\u4e4e\u662fBash\u548c\u5176\u4ed6\u6807\u51c6Shell\u7684\u56db\u500d\u3002<\/p>\n

Dash\u7684\u7b80\u7ea6\u8bbe\u8ba1\u4f7f\u5176\u6bd4\u65e5\u5e38\u7684\u547d\u4ee4\u884c\u89e3\u91ca\u5668\u5c0f\u5f97\u591a\uff0c\u5e76\u4e14\u53ea\u8981\u6709\u9650\u7684\u7cfb\u7edf\u8d44\u6e90(\u78c1\u76d8\u7a7a\u95f4\uff0cRAM\u6216CPU)\u3002<\/p>\n

\u7531\u4e8eDash\u7684\u4ee3\u7801\u5e93\u660e\u663e\u8f83\u5c0f\uff0c\u56e0\u6b64Dash\u7684\u53d7\u653b\u51fb\u9762\u8f83\u5c0f\uff0c\u5e76\u4e14\u5bf9\u4e8e\u9891\u7e41\u7684Shell\u653b\u51fb\u975e\u5e38\u5b89\u5168\u3002<\/p>\n

Ubuntu\u6216Debian\u7cfb\u7edf\u7528\u6237\u53ef\u4ee5\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u8f93\u5165man dash\u6765\u627e\u5230\u6709\u5173Dash\u7684\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n

10. Eshell<\/strong><\/span><\/div>\n

Eshell\u662f\u4f7f\u7528Emacs Lisp\u7f16\u5199\u7684\u4e00\u79cd\u65b9\u4fbf\u7684\u547d\u4ee4\u884c\u89e3\u91ca\u5668\u7a0b\u5e8f\uff0c\u5176\u76ee\u7684\u662f\u5728\u63d0\u4f9b\u5bf9Lisp\u4ee3\u7801\u7684\u65e0\u7f1d\u652f\u6301\u7684\u540c\u65f6\u5177\u6709\u9ad8\u5ea6\u7684\u53ef\u79fb\u690d\u6027\u3002\u5b83\u63d0\u4f9b\u4e86\u5927\u91cf\u65e5\u5e38\u529f\u80fd\uff0c\u5305\u62ec\u81ea\u52a8\u5b8c\u6210\uff0c\u5386\u53f2\u8bb0\u5f55\u7ba1\u7406\uff0c\u4f5c\u4e1a\u63a7\u5236\u673a\u5236\u7b49\u7b49\u3002Eshell\u9644\u5e26\u7684\u811a\u672c\u7ed3\u6784\u975e\u5e38\u7b80\u5355\uff0c\u53ef\u4ee5\u6b63\u786e\u5b8c\u6210\u5de5\u4f5c\u3002\u5982\u679c\u60a8\u662fLisp\u7a0b\u5e8f\u5458\u6216\u524d\u536b\u7684Emacs\u7231\u597d\u8005\uff0c\u90a3\u4e48Eshell\u53ef\u4ee5\u6210\u4e3a\u60a8\u7406\u60f3\u7684Linux Shell\u3002<\/p>\n

Eshell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Eshell\u4e0d\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u7ec8\u7aef\u6a21\u62df\u5668\uff0c\u800c\u662f\u4e00\u4e2a\u65e5\u5e38shell\uff0c\u53ef\u4ee5\u4f7f\u7528Emacs\u7684\u529f\u80fd\u4e0e\u60a8\u7684\u8ba1\u7b97\u673a\u8fdb\u884c\u901a\u4fe1\u3002<\/p>\n

\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u5b83\u4e0d\u76f4\u63a5\u652f\u6301\u4ea4\u4e92\u5f0f\u7a0b\u5e8f\uff0c\u56e0\u6b64\u60a8\u9700\u8981\u5728\u5355\u72ec\u7684ANSI\u672f\u8bed\u5b9e\u4f8b\u4e2d\u8c03\u7528\u5b83\u4eec\u3002<\/p>\n

Eshell\u5bf9\u5386\u53f2\u8bb0\u5f55\u4fee\u6539\u548c\u4ea4\u4e92\u7684\u9ed8\u8ba4\u652f\u6301\u975e\u5e38\u597d\uff0c\u5176\u8bed\u6cd5\u5728\u67d0\u79cd\u7a0b\u5ea6\u4e0a\u7c7b\u4f3c\u4e8eBash\u548cZsh\u3002<\/p>\n

\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539eshell-prompt-function\u53d8\u91cf\u6765\u81ea\u5b9a\u4e49Eshell\uff0c\u8be5\u53d8\u91cf\u5b9a\u4e49\u4e86\u63d0\u793a\u5728\u7cfb\u7edf\u4e2d\u7684\u884c\u4e3a\u3002<\/p>\n

11. rc Shell<\/strong><\/span><\/div>\n

rc shell\u662f\u7ecf\u5178\u7684\u547d\u4ee4\u884c\u89e3\u91ca\u5668\uff0c\u4e0eBourne shell\u6781\u4e3a\u76f8\u4f3c\u3002\u4f46\u662f\uff0c\u4e0eBourne Shell\u76f8\u6bd4\uff0c\u5b83\u5177\u6709\u67d0\u79cd\u7b80\u5355\u7684\u7ed3\u6784\u3002\u8fd9\u662f\u56e0\u4e3arc\u4f7f\u7528\u7c7b\u4f3cC\u7684\u63a7\u5236\u7ed3\u6784\uff0c\u800c\u4e0d\u662fsh\u4f7f\u7528\u7c7b\u4f3cALGOL\u7684\u8bed\u6cd5\u3002Tom Duff\u662f\u8be5Unix Shell\u7684\u4e3b\u8981\u5f00\u53d1\u4eba\u5458\uff0c\u4ee5\u5176\u9ad8\u8d28\u91cf\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u548c\u51fa\u8272\u7684\u89e3\u51b3\u95ee\u9898\u80fd\u529b\u800c\u95fb\u540d\u3002<\/p>\n

rc Shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

rc\u4f7f\u7528if not scripting\u7ed3\u6784\u800c\u4e0d\u662fvanilla else\uff0c\u5e76\u63d0\u4f9b\u4e0e\u5728Bourne shell\u4e2d\u4f7f\u7528\u7684for\u5faa\u73af\u76f8\u540c\u7684for\u5faa\u73af\u3002<\/p>\n

\u5c3d\u7ba1rc\u7684\u8f93\u5165\u89c4\u5219\u5f88\u5f31\uff0c\u4f46\u662f\u5b83\u7ed3\u5408\u4e86\u5f3a\u5927\u7684\u673a\u5236\u6765\u64cd\u7eb5\u53d8\u91cf\u3002<\/p>\n

rc\u76f8\u5f53\u8f7b\u5de7\uff0c\u56e0\u6b64\u6bd4\u8bb8\u591a\u4f20\u7edf\u7684Linux\u5f00\u6e90shell\u66f4\u5feb\u3002<\/p>\n

\u5b83\u5177\u6709\u5bf9\u5f02\u5e38\u5904\u7406\uff0c\u641c\u7d22\u548c\u66ff\u6362\u673a\u5236\uff0c\u6a21\u5f0f\u5339\u914d\u7b49\u7684\u51fa\u8272\u652f\u6301\u3002<\/p>\n

12. Elvish shell<\/strong><\/span><\/div>\n

\u81ea\u4ece\u51e0\u4e2a\u6708\u524d\u5c1d\u8bd5\u4f7f\u7528Elvish Shell\u4ee5\u6765\uff0c\u5b83\u662f\u6211\u6700\u559c\u6b22\u7684Linux\u5f00\u6e90shell\u4e4b\u4e00\u3002\u8fd9\u662f\u4e00\u4e2a\u771f\u6b63\u51fa\u8272\u7684\u547d\u4ee4\u884c\u89e3\u91ca\u5668\uff0c\u53ef\u8ba9\u60a8\u5728\u8ba1\u7b97\u673a\u4e0a\u6267\u884c\u5404\u79cd\u64cd\u4f5c\u3002\u4ece\u64cd\u7eb5\u7cfb\u7edf\u672c\u8eab\u5230\u7f16\u5199\u96c4\u8fa9\u7684\u811a\u672c\uff0cElvish\u5747\u53ef\u7528\u4e8e\u5b8c\u6210\u5927\u91cf\u4efb\u52a1\u3002\u5b83\u5e26\u6709\u4e30\u5bcc\u7684\u5065\u58ee\u51fd\u6570\u5e93\uff0c\u53ef\u7528\u4e8e\u5b57\u7b26\u4e32\u5904\u7406\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\uff0cJSON\u89e3\u6790\uff0c\u8054\u7f51\u7b49\u3002<\/p>\n

Elvish shell\u7684\u529f\u80fd\uff1a<\/strong><\/p>\n

Elvish\u7ba1\u9053\u5141\u8bb8\u7cfb\u7edf\u4e0e\u6807\u51c6\u6587\u672c\u6570\u636e\u4e00\u8d77\u6d41\u5f0f\u4f20\u8f93\u8bf8\u5982\u5217\u8868\uff0c\u5730\u56fe\u751a\u81f3\u529f\u80fd\u4e4b\u7c7b\u7684\u7ed3\u6784\u5316\u6570\u636e\u3002<\/p>\n

\u5b83\u5e26\u6709\u7c7b\u4f3cC\u7684\u719f\u6089\u8bed\u6cd5\uff0c\u5bf9\u4e8e\u7ecf\u9a8c\u4e30\u5bcc\u7684Linux\u7528\u6237\u800c\u8a00\uff0c\u4f7f\u7528Elvish\u7f16\u5199\u811a\u672c\u975e\u5e38\u76f4\u89c2\u3002<\/p>\n

Elvish\u662f\u4f7f\u7528Go\u7f16\u7a0b\u8bed\u8a00\u7f16\u5199\u7684\uff0c\u56e0\u6b64\u4e0e\u5176\u4ed6Unix Shell\u76f8\u6bd4\uff0c\u5b83\u662f\u7c7b\u578b\u5b89\u5168\u7684\u3002<\/p>\n

\u8be5Unix Shell\u9644\u5e26\u4e86\u4e00\u4e2a\u9884\u6784\u5efa\u7684\u6587\u4ef6\u7ba1\u7406\u5668\uff0c\u4f7f\u7cfb\u7edf\u7ba1\u7406\u66f4\u52a0\u8212\u9002\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u7531\u4e8eLinux\u4e0d\u65ad\u53d1\u5c55\u7684\u751f\u6001\u7cfb\u7edf\u63d0\u4f9b\u4e86\u8bb8\u591a\u5f3a\u5927\u7684\u5f00\u6e90Shell\uff0c\u56e0\u6b64\u4e3a\u60a8\u9009\u62e9\u5408\u9002\u7684Linux Shell\u901a\u5e38\u662f\u4e00\u9879\u8270\u5de8\u7684\u4efb\u52a1\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u5458\u904d\u5386\u4e86\u60a8\u53ef\u4ee5\u627e\u5230\u7684\u6240\u6709\u6d41\u884c\u9009\u62e9\uff0c\u5e76\u4e3a\u60a8\u7f16\u5199\u4e86\u6b64\u4fbf\u6377\u6307\u5357\u3002\u7531\u4e8e\u4eba\u4eec\u5bf9\u4e0d\u540c\u79cd\u7c7b\u7684Shell\u6709\u4e0d\u540c\u7684\u504f\u597d\uff0c\u56e0\u6b64\u6700\u9002\u5408\u60a8\u7684Shell\u5b8c\u5168\u53d6\u51b3\u4e8e\u60a8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u81ea\u4ece70\u5e74\u4ee3Unix\u7cfb\u7edf\u8bde\u751f\u4ee5\u6765\uff0c\u5b83\u5c31\u4e00\u76f4\u5438\u5f15\u7740\u5168\u4e16\u754c\u7684\u76ee\u5149\u3002\u5e2e\u52a9Linux\u548cBSD\u53d1\u884c\u7248\u786e\u4fdd\u5176\u5f53\u524d\u5730\u4f4d\u7684\u57fa\u672c […]<\/p>\n","protected":false},"author":370,"featured_media":10431,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-177818","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/177818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/370"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=177818"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/177818\/revisions"}],"predecessor-version":[{"id":177997,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/177818\/revisions\/177997"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/10431"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=177818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=177818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=177818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}