{"id":62073,"date":"2025-04-29T12:36:35","date_gmt":"2025-04-29T04:36:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/62073\/"},"modified":"2025-04-29T12:36:35","modified_gmt":"2025-04-29T04:36:35","slug":"linux-%e8%b6%85%e7%ba%a7%e6%bc%82%e4%ba%ae%e7%9a%84-shell-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/62073\/","title":{"rendered":"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell"},"content":{"rendered":"<p>  <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5148\u6765\u4e00\u5f20\u7f8e\u56fe<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/273ed0b22f85a5f45754ef95a5eb1c76-0.png\" class=\"aligncenter\" title=\"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u63d2\u56fe\" alt=\"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u63d2\u56fe\" \/><\/p>\n<p>  <\/p>\n<h1><span>1 zsh \u4ecb\u7ecd<\/span><\/h1>\n<h2><span>1.1 Linux shell<\/span><\/h2>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">Linux\/Unix \u63d0\u4f9b\u4e86\u5f88\u591a\u79cd Shell\uff0c\u4e3a\u6bdb\u8981\u8fd9\u4e48\u591a Shell\uff1f<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u96be\u9053\u7528\u6765\u7092\u7740\u5403\u4e48\uff1f\u90a3\u6211\u95ee\u4f60\uff0c\u4f60\u540c\u7c7b\u578b\u7684\u8863\u670d\u600e\u4e48\u6709\u90a3\u4e48\u591a\u4ef6\uff1f\u82b1\u8272\uff0c\u8d28\u5730\u8fd8\u4e0d\u4e00\u6837\u3002\u5199\u7a0b\u5e8f\u6bd4\u4e70\u8863\u670d\u590d\u6742\u591a\u4e86\uff0c\u800c\u4e14\u7a0b\u5e8f\u5458\u5f80\u5f80\u8d1f\u8d23\u628a\u590d\u6742\u7684\u4e8b\u60c5\u641e\u7b80\u5355\uff0c\u7b80\u5355\u7684\u4e8b\u60c5\u641e\u590d\u6742\u3002\u725b\u7a0b\u5e8f\u5458\u770b\u5230\u4e0d\u723d\u7684 Shell\uff0c\u5c31\u4f1a\u81ea\u5df1\u91cd\u65b0\u5199\u4e00\u5957\uff0c\u6162\u6162\u5f62\u6210\u4e86\u4e00\u4e9b\u6807\u51c6\uff0c\u5e38\u7528\u7684 Shell \u6709\u8fd9\u4e48\u51e0\u79cd\uff0csh\u3001bash\u3001csh \u7b49\uff0c\u60f3\u77e5\u9053\u4f60\u7684\u7cfb\u7edf\u6709\u51e0\u79cd shell\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\uff1a<\/p>\n<pre>cat&nbsp;\/etc\/shells<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u663e\u793a\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/e310b016ecb3836fdac8ac4d44dfcc14-1.png\" class=\"aligncenter\" title=\"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u63d2\u56fe1\" alt=\"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u63d2\u56fe1\" \/>  <\/p>\n<h2><span>1.2 zsh \u7b80\u4ecb<\/span><\/h2>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">Zsh \u662f\u4e00\u4e2a Linux \u4e0b\u5f3a\u5927\u7684 shell, \u7531\u4e8e\u5927\u591a\u6570 Linux \u4ea7\u54c1\u5b89\u88c5\uff0c\u4ee5\u53ca\u9ed8\u8ba4\u4f7f\u7528bash shell, \u4f46\u662f\u4e1d\u6beb\u4e0d\u5f71\u54cd\u6781\u5ba2\u4eec\u5bf9 zsh \u7684\u70ed\u8877, \u51e0\u4e4e\u6bcf\u4e00\u6b3e Linux \u4ea7\u54c1\u90fd\u5305\u542b\u6709 zsh\uff0c\u901a\u5e38\u53ef\u4ee5\u7528 apt-get\u3001urpmi \u6216 yum \u7b49\u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">Zsh \u5177\u6709\u4ee5\u4e0b\u4e3b\u8981\u529f\u80fd<\/p>\n<ul>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u5f00\u7bb1\u5373\u7528\u3001\u53ef\u7f16\u7a0b\u7684\u547d\u4ee4\u884c\u8865\u5168\u529f\u80fd\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u8f93\u5165\u5404\u79cd\u53c2\u6570\u4ee5\u53ca\u9009\u9879<\/p>\n<\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u5728\u7528\u6237\u542f\u52a8\u7684\u6240\u6709 shell \u4e2d \u5171\u4eab\u547d\u4ee4\u5386\u53f2<\/p>\n<\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u901a\u8fc7\u6269\u5c55\u7684\u6587\u4ef6\u901a\u914d\u7b26\uff0c\u53ef\u4ee5\u4e0d\u5229\u7528\u5916\u90e8\u547d\u4ee4\u8fbe\u5230 find \u547d\u4ee4\u4e00\u822c\u5c55\u5f00\u6587\u4ef6\u540d<\/p>\n<\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u6539\u8fdb\u7684\u53d8\u91cf\u4e0e\u6570\u7ec4\u5904\u7406<\/p>\n<\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u5728\u7f13\u51b2\u533a\u4e2d\u7f16\u8f91\u591a\u884c\u547d\u4ee4<\/p>\n<\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u591a\u79cd\u517c\u5bb9\u6a21\u5f0f\uff0c\u4f8b\u5982\u4f7f\u7528 \/ bin\/sh \u8fd0\u884c\u65f6\u53ef\u4ee5\u4f2a\u88c5\u6210 Bourne shell<\/p>\n<\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u53ef\u4ee5\u5b9a\u5236\u5448\u73b0\u5f62\u5f0f\u7684\u63d0\u793a\u7b26\uff1b\u5305\u62ec\u5728\u5c4f\u5e55\u53f3\u7aef\u663e\u793a\u4fe1\u606f\uff0c\u5e76\u5728\u952e\u5165\u957f\u547d\u4ee4\u65f6\u81ea\u52a8\u9690\u85cf<\/p>\n<\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u53ef\u52a0\u8f7d\u7684\u6a21\u5757\uff0c\u63d0\u4f9b\u5176\u4ed6\u5404\u79cd\u652f\u6301\uff1a\u5b8c\u6574\u7684 TCP \u4e0e Unix \u57df\u5957\u63a5\u5b57\u63a7\u5236\uff0cFTP \u5ba2\u6237\u7aef\u4e0e\u6269\u5145\u8fc7\u7684\u6570\u5b66\u51fd\u6570<\/p>\n<\/li>\n<li>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black\">\u5b8c\u5168\u53ef\u5b9a\u5236\u5316<\/p>\n<\/li>\n<\/ul>\n<h2><span>1.3 zsh \u4e0e oh-my-zsh \u7ec8\u6781\u914d\u7f6e<\/span><\/h2>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u4e4b\u524d\u662f\u56e0\u4e3a\u770b\u5230\u8fd9\u7bc7\u6587\u7ae0\uff1a\u7ec8\u6781 Shell\u2014\u2014Zsh \u624d\u9009\u62e9\u4f7f\u7528 zsh\uff0c\u88ab\u5b83\u7684\u81ea\u52a8\u5b8c\u6210\u3001\u8865\u5168\u529f\u80fd\u5438\u5f15\u4e86\u3002\u5b98\u7f51\uff1awww.zsh.org<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u9009\u62e9 oh-my-zsh, oh-my-zsh \u662f\u57fa\u4e8e zsh \u7684\u529f\u80fd\u505a\u4e86\u4e00\u4e2a\u6269\u5c55\uff0c\u65b9\u4fbf\u7684\u63d2\u4ef6\u7ba1\u7406\u3001\u4e3b\u9898\u81ea\u5b9a\u4e49\uff0c\u4ee5\u53ca\u6f02\u4eae\u7684\u81ea\u52a8\u5b8c\u6210\u6548\u679c\u3002<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5728 Github \u4e0a\u627e\u5173\u4e8e zsh \u7684\u9879\u76ee\u65f6\u53d1\u73b0\u7684\uff0c\u8bd5\u7528\u4e86\u4e00\u4e0b\u89c9\u5f97\u5f88\u65b9\u4fbf\uff0c\u4e0d\u7528\u50cf\u4e0a\u9762\u6587\u7ae0\u91cc\u9762\u63d0\u5230\u7684\u90a3\u4e48\u590d\u6742\uff0c\u914d\u7f6e\u4e00\u4e9b\u63d2\u4ef6\u7684\u540d\u79f0\u5373\u53ef\u4f7f\u7528\u76f8\u5e94\u7684\u529f\u80fd\u3002<\/p>\n<pre>\u725b\u903c\u554a\uff01\u63a5\u79c1\u6d3b\u5fc5\u5907\u7684&nbsp;N&nbsp;\u4e2a\u5f00\u6e90\u9879\u76ee\uff01\u8d76\u5feb\u6536\u85cf<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5b98\u7f51\uff1ahttps:\/\/github.com\/robbyrussell\/oh-my-zsh<\/p>\n<h1><span>2 \u5b89\u88c5 zsh<\/span><\/h1>\n<h2><span>2.1 \u5b89\u88c5 zsh<\/span><\/h2>\n<blockquote style=\"margin-top: 20px;margin-bottom: 20px;padding: 10px 10px 10px 20px;font-size: 0.9em;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\">\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-size: 16px;color: black;line-height: 26px\">\u5bf9\u4e8e\u4e00\u822c\u7684 Ubuntu \u7cfb\u7edf\uff0c\u914d\u7f6e\u597d\u6b63\u786e\u7684\u6e90\u4e4b\u540e\uff0c\u5c31\u80fd\u76f4\u63a5\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/blockquote>\n<pre>sudo&nbsp;apt-get&nbsp;install&nbsp;zsh<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h2><span>2.2 \u914d\u7f6e zsh<\/span><\/h2>\n<blockquote style=\"margin-top: 20px;margin-bottom: 20px;padding: 10px 10px 10px 20px;font-size: 0.9em;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\">\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-size: 16px;color: black;line-height: 26px\">zsh \u7684\u914d\u7f6e\u662f\u4e00\u95e8\u5927\u5b66\u95ee\uff0c\u8fd9\u91cc\u4e0d\u8d58\u8ff0\uff0c\u76f4\u63a5\u7ed9\u51fa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u5927\u5bb6\u53ef\u4ee5\u4e0b\u8f7d\u540e\u653e\u5165 zsh \u914d\u7f6e\u6587\u6863\u76f4\u63a5\u4f7f\u7528\u3002\uff08\u6211\u7684\u4e00\u4e2a\u6cd5\u56fd\u670b\u53cb\u624b\u914d\u7684\uff0c\u76f8\u5f53\u987a\u624b\uff09<\/p>\n<\/blockquote>\n<blockquote style=\"margin-top: 20px;margin-bottom: 20px;padding: 10px 10px 10px 20px;font-size: 0.9em;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\">\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-size: 16px;color: black;line-height: 26px\">\u628a. zshrc \u62f7\u8d1d\u5230\u76f8\u5e94\u7528\u6237\u7684 home \u76ee\u5f55\u5373\u53ef(\u4e5f\u53ef\u4ee5\u628a\u4f60\u7684 bash \u7684\u914d\u7f6e\u6587\u4ef6 (~\/.bash_prorile \u6216\u8005~\/.profile \u7b49) \u7ed9\u62f7\u8d1d\u5230 zsh \u7684\u914d\u7f6e\u6587\u4ef6~\/.zshrc \u91cc\uff0c\u56e0\u4e3a zsh \u517c\u5bb9 bash)<\/p>\n<\/blockquote>\n<h2><span>2.3 \u53d6\u4ee3 bash\uff0c\u8bbe\u4e3a\u9ed8\u8ba4 shell<\/span><\/h2>\n<pre>sudo&nbsp;usermod&nbsp;-s&nbsp;\/bin\/zsh&nbsp;username<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\">\u6216\u8005<\/p>\n<pre>chsh&nbsp;-s&nbsp;\/bin\/zsh<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    <\/p>\n<pre>chsh&nbsp;-s&nbsp;`which&nbsp;zsh`<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5982\u679c\u8981\u5207\u6362\u56de\u53bb bash\uff1a<\/p>\n<pre>chsh&nbsp;-s&nbsp;\/bin\/bash<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5f53\u7136\u4f60\u5b9e\u5728\u4e0d\u613f\u610f\u628a zsh \u5f53\u6210\u9ed8\u8ba4\u7684 shell, \u800c\u53c8\u60f3\u4f7f\u7528\u5b83, \u90a3\u4e48\u4f60\u53ef\u4ee5\u6bcf\u6b21\u8fdb\u5165\u662f\u90fd\u4f7f\u7528zsh\u8fdb\u5165, \u800c\u8f93\u5165exit\u9000\u51fa<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/e310b016ecb3836fdac8ac4d44dfcc14-2.png\" class=\"aligncenter\" title=\"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u63d2\u56fe2\" alt=\"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u63d2\u56fe2\" \/>  <\/p>\n<h2><span>2.4 \u5b89\u88c5 oh-my-zsh<\/span><\/h2>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u76f4\u63a5\u7528 zsh \u4f1a\u5f88\u86cb\u75bc\uff0c\u56e0\u4e3a zsh \u529f\u80fd\u5f88\u5f3a\u5927\u4f46\u662f\u592a\u590d\u6742\uff0c\u6240\u4ee5\u9700\u8981 oh-my-zsh \u6765\u5c06\u5b83\u7b80\u5355\u5316\u3002\u53e6\u5916\uff0c\u641c\u7d22\u516c\u4f17\u53f7Linux\u5c31\u8be5\u8fd9\u6837\u5b66\u540e\u53f0\u56de\u590d\u201cLinux\u201d\uff0c\u83b7\u53d6\u4e00\u4efd\u60ca\u559c\u793c\u5305\u3002<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>\u76f4\u63a5\u7528 git \u4ece github \u4e0a\u9762\u4e0b\u8f7d\u5305<\/strong><\/span><\/p>\n<pre>git&nbsp;clone&nbsp;git:\/\/github.com\/robbyrussell\/oh-my-zsh.git&nbsp;~\/.oh-my-zsh<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>\u5907\u4efd\u5df2\u6709\u7684 zshrc, \u66ff\u6362 zshrc<\/strong><\/span><\/p>\n<pre>cp&nbsp;~\/.zshrc&nbsp;~\/.zshrc.origcp&nbsp;~\/.oh-my-zsh\/templates\/zshrc.zsh-template&nbsp;~\/.zshrc<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>\u76f4\u63a5\u4f7f\u7528\u811a\u672c\u5b89\u88c5<\/strong><\/span><\/p>\n<pre>cd&nbsp;oh-my-zsh\/tools.\/install.sh<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<blockquote style=\"margin-top: 20px;margin-bottom: 20px;padding: 10px 10px 10px 20px;font-size: 0.9em;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\">\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-size: 16px;color: black;line-height: 26px\">\u4f60\u53ef\u4ee5\u76f4\u63a5\u76f4\u63a5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5<\/p>\n<\/blockquote>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>curl<\/strong><\/span><\/p>\n<pre>sh&nbsp;-c&nbsp;\"$(curl&nbsp;-fsSL&nbsp;https:\/\/raw.githubusercontent.com\/robbyrussell\/oh-my-zsh\/master\/tools\/install.sh)\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>wget<\/strong><\/span><\/p>\n<pre>sh&nbsp;-c&nbsp;\"$(wget&nbsp;https:\/\/raw.githubusercontent.com\/robbyrussell\/oh-my-zsh\/master\/tools\/install.sh&nbsp;-O&nbsp;-)\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5176\u672c\u8d28\u5c31\u662f\u4e0b\u8f7d\u5e76\u6267\u884c\u4e86 github \u4e0a\u7684 install.sh \u811a\u672c, \u8be5\u811a\u672c\u4f4d\u4e8eoh-my-zsh\/tools\/install.sh<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>\u914d\u7f6e\u4e3b\u9898<\/strong><\/span><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\">oh-my-zsh \u96c6\u6210\u4e86\u5927\u91cf\u7684\u4e3b\u9898, \u4f4d\u4e8e&nbsp;oh-my-zsh\/theme<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u914d\u7f6e\u4e3b\u9898, \u53ef\u4ee5\u901a\u8fc7\u4fee\u6539~\/.zshrc\u4e2d\u7684\u73af\u5883\u53d8\u91cfZSH_THEME\u6765\u5b8c\u6210<\/p>\n<pre>ZSH_THEME=\"agnoster\"&nbsp;#&nbsp;(this&nbsp;is&nbsp;one&nbsp;of&nbsp;the&nbsp;fancy&nbsp;ones)<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5982\u679c\u4f60\u89c9\u5f97\u4e3b\u9898\u592a\u591a\u4f60\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528\u968f\u673a\u6a21\u5f0f, \u6765\u7531\u7cfb\u7edf\u968f\u673a\u9009\u62e9<\/p>\n<pre>ZSH_THEME=\"random\"&nbsp;#&nbsp;(...please&nbsp;let&nbsp;it&nbsp;be&nbsp;pie...&nbsp;please&nbsp;be&nbsp;some&nbsp;pie..)<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236<br \/>\n<img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/275\/013\/84335300357ba2cf4c9a81f6251c718c-3.png\" class=\"aligncenter\" title=\"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u63d2\u56fe3\" alt=\"Linux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u63d2\u56fe3\" \/>  <\/p>\n<p style=\"max-width:90%\">\u8be6\u7ec6\u7684\u4e3b\u9898\u4fe1\u606f, \u53ef\u4ee5\u53c2\u89c1 zsh \u4e3b\u9898\u4ecb\u7ecd<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>\u914d\u7f6e\u63d2\u4ef6<\/strong><\/span><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u4fee\u6539\uff5e\/.zshrc\u4e2dplugins<\/p>\n<pre>plugins=(git&nbsp;bundler&nbsp;osx&nbsp;rake&nbsp;ruby)<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u8be6\u7ec6\u7684\u63d2\u4ef6\u4fe1\u606f, \u53ef\u4ee5\u53c2\u89c1 zsh \u63d2\u4ef6 Plugins \u4ecb\u7ecd<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>\u66f4\u65b0 oh-my-zsh<\/strong><\/span><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b, \u60a8\u5c06\u88ab\u63d0\u793a\u68c0\u67e5\u6bcf\u51e0\u5468\u7684\u5347\u7ea7. \u5982\u679c\u4f60\u60f3\u6211 ZSH \u81ea\u52a8\u5347\u7ea7\u672c\u8eab\u6ca1\u6709\u63d0\u793a\u4f60, \u4fee\u6539 `~\/.zshrc\u3002\u53e6\u5916\uff0c\u641c\u7d22\u516c\u4f17\u53f7\u9876\u7ea7\u7b97\u6cd5\u540e\u53f0\u56de\u590d\u201c\u7b97\u6cd5\u201d\uff0c\u83b7\u53d6\u4e00\u4efd\u60ca\u559c\u793c\u5305\u3002<\/p>\n<pre>disable_update_prompt&nbsp;=&nbsp;true<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u7981\u7528\u81ea\u52a8\u5347\u7ea7, \u4fee\u6539~\/.zshrc<\/p>\n<pre>disable_auto_update&nbsp;=&nbsp;true<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u9009\u62e9\u624b\u52a8\u66f4\u65b0<\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5982\u679c\u4f60\u60f3\u5728\u4efb\u4f55\u65f6\u95f4\u70b9\u5347\u7ea7\uff08\u4e5f\u8bb8\u6709\u4eba\u521a\u521a\u53d1\u5e03\u4e86\u4e00\u4e2a\u65b0\u7684\u63d2\u4ef6\uff0c\u4f60\u4e0d\u60f3\u7b49\u5f85\u4e00\u4e2a\u661f\u671f\uff1f) \u4f60\u53ea\u9700\u8981\u8fd0\u884c\uff1a<\/p>\n<pre>upgrade_oh_my_zsh<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;letter-spacing: 0.544px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light,\"><span><strong>\u5378\u8f7d oh-my-zsh<\/strong><\/span><\/p>\n<p style=\"margin-top: 5px;margin-bottom: 20px;padding-top: 8px;padding-bottom: 8px;font-family: system-ui, -apple-system, BlinkMacSystemFont,\">\u5982\u679c\u4f60\u60f3\u5378\u8f7doh-my-zsh, \u53ea\u9700\u8981\u6267\u884cuninstall_oh_my_zsh zsh\uff0c \u4ece\u547d\u4ee4\u884c\u8fd0\u884c. \u8fd9\u5c06\u5220\u9664\u672c\u8eab\u548c\u6062\u590d\u4f60\u4ee5\u524d\u7684 bash \u6216\u8005 zsh \u914d\u7f6e.<\/p>\n<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fLinux \u8d85\u7ea7\u6f02\u4eae\u7684 Shell\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u6765\u4e00\u5f20\u7f8e\u56fe 1 zsh \u4ecb\u7ecd 1.1 Linux shell Linux\/Unix \u63d0\u4f9b\u4e86\u5f88\u591a\u79cd Shell\uff0c\u4e3a\u6bdb\u8981\u8fd9\u4e48\u591a Shell\uff1f \u96be\u9053\u7528\u6765\u7092\u7740\u5403\u4e48\uff1f\u90a3\u6211\u95ee\u4f60\uff0c\u4f60\u540c\u7c7b\u578b\u7684\u8863\u670d\u600e\u4e48\u6709\u90a3\u4e48\u591a\u4ef6\uff1f\u82b1\u8272\uff0c\u8d28\u5730\u8fd8\u4e0d\u4e00\u6837\u3002\u5199\u7a0b\u5e8f\u6bd4\u4e70\u8863\u670d\u590d\u6742\u591a\u4e86\uff0c\u800c\u4e14\u7a0b\u5e8f\u5458\u5f80\u5f80\u8d1f\u8d23\u628a\u590d\u6742\u7684\u4e8b\u60c5\u641e\u7b80\u5355\uff0c\u7b80\u5355\u7684\u4e8b\u60c5\u641e\u590d\u6742\u3002\u725b\u7a0b\u5e8f\u5458\u770b\u5230\u4e0d\u723d\u7684 Shell\uff0c\u5c31\u4f1a\u81ea\u5df1\u91cd\u65b0\u5199\u4e00\u5957\uff0c\u6162\u6162\u5f62\u6210\u4e86\u4e00\u4e9b\u6807\u51c6\uff0c\u5e38\u7528\u7684 Shell \u6709\u8fd9\u4e48\u51e0\u79cd\uff0csh\u3001bash\u3001csh \u7b49\uff0c\u60f3\u77e5\u9053\u4f60\u7684\u7cfb\u7edf\u6709\u51e0\u79cd shell\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\uff1a cat&nbsp;\/etc\/shells \u767b\u5f55\u540e\u590d\u5236 \u663e\u793a\u5982\u4e0b\uff1a 1.2 zsh \u7b80\u4ecb Zsh \u662f\u4e00\u4e2a Linux \u4e0b\u5f3a\u5927\u7684 shell, \u7531\u4e8e\u5927\u591a\u6570 Linux \u4ea7\u54c1\u5b89\u88c5\uff0c\u4ee5\u53ca\u9ed8\u8ba4\u4f7f\u7528bash shell, \u4f46\u662f\u4e1d\u6beb\u4e0d\u5f71\u54cd\u6781\u5ba2\u4eec\u5bf9 zsh \u7684\u70ed\u8877, \u51e0\u4e4e\u6bcf\u4e00\u6b3e Linux \u4ea7\u54c1\u90fd\u5305\u542b\u6709 zsh\uff0c\u901a\u5e38\u53ef\u4ee5\u7528 apt-get\u3001urpmi \u6216 yum \u7b49\u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5 Zsh \u5177\u6709\u4ee5\u4e0b\u4e3b\u8981\u529f\u80fd \u5f00\u7bb1\u5373\u7528\u3001\u53ef\u7f16\u7a0b\u7684\u547d\u4ee4\u884c\u8865\u5168\u529f\u80fd\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u8f93\u5165\u5404\u79cd\u53c2\u6570\u4ee5\u53ca\u9009\u9879 \u5728\u7528\u6237\u542f\u52a8\u7684\u6240\u6709 shell \u4e2d \u5171\u4eab\u547d\u4ee4\u5386\u53f2 \u901a\u8fc7\u6269\u5c55\u7684\u6587\u4ef6\u901a\u914d\u7b26\uff0c\u53ef\u4ee5\u4e0d\u5229\u7528\u5916\u90e8\u547d\u4ee4\u8fbe\u5230 find \u547d\u4ee4\u4e00\u822c\u5c55\u5f00\u6587\u4ef6\u540d \u6539\u8fdb\u7684\u53d8\u91cf\u4e0e\u6570\u7ec4\u5904\u7406 \u5728\u7f13\u51b2\u533a\u4e2d\u7f16\u8f91\u591a\u884c\u547d\u4ee4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-62073","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/62073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=62073"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/62073\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=62073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=62073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=62073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}