{"id":176368,"date":"2020-04-21T10:24:05","date_gmt":"2020-04-21T02:24:05","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=176368"},"modified":"2020-04-09T09:25:55","modified_gmt":"2020-04-09T01:25:55","slug":"shell-fish","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/shell-fish.html","title":{"rendered":"\u667a\u80fd\u4e14\u7528\u6237\u53cb\u597d\u7684\u547d\u4ee4\u884c shell–Fish"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nFish\uff08\u53cb\u597d\u7684\u4ea4\u4e92\u5f0f shell\uff09\u662f\u4e00\u4e2a\u667a\u80fd\u4e14\u7528\u6237\u53cb\u597d\u7684\u547d\u4ee4\u884c shell\uff0c\u53ef\u5728 Linux\u3001MacOS \u548c\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002\u53ef\u4ee5\u5c06\u5176\u7528\u4e8e\u7ec8\u7aef\u7684\u65e5\u5e38\u5de5\u4f5c\u548c\u811a\u672c\u7f16\u5199\u3002\u7528 fish \u7f16\u5199\u7684\u811a\u672c\u6bd4\u76f8\u540c\u7684 bash \u7248\u672c\u5177\u6709\u66f4\u5c11\u7684\u795e\u79d8\u6027\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"
\n\u4f60\u662f\u5426\u6b63\u5728\u5bfb\u627e bash \u7684\u66ff\u4ee3\u54c1\uff1f\u4f60\u662f\u5426\u5728\u5bfb\u627e\u66f4\u4eba\u6027\u5316\u7684\u4e1c\u897f\uff1f\u4e0d\u7528\u518d\u770b\u4e86\uff0c\u56e0\u4e3a\u4f60\u521a\u53d1\u73b0\u4e86 fish\uff01<\/p>\n

Fish\uff08\u53cb\u597d\u7684\u4ea4\u4e92\u5f0f shell\uff09\u662f\u4e00\u4e2a\u667a\u80fd\u4e14\u7528\u6237\u53cb\u597d\u7684\u547d\u4ee4\u884c shell\uff0c\u53ef\u5728 Linux\u3001MacOS \u548c\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002\u53ef\u4ee5\u5c06\u5176\u7528\u4e8e\u7ec8\u7aef\u7684\u65e5\u5e38\u5de5\u4f5c\u548c\u811a\u672c\u7f16\u5199\u3002\u7528 fish \u7f16\u5199\u7684\u811a\u672c\u6bd4\u76f8\u540c\u7684 bash \u7248\u672c\u5177\u6709\u66f4\u5c11\u7684\u795e\u79d8\u6027\u3002<\/p>\n

Fish \u7684\u7528\u6237\u53cb\u597d\u529f\u80fd<\/strong><\/div>\n
    \n
  • \u5efa\u8bae\uff1aFish \u4f1a\u63d0\u793a\u4f60\u4e4b\u524d\u5199\u8fc7\u7684\u547d\u4ee4\u3002\u5f53\u7ecf\u5e38\u8f93\u5165\u76f8\u540c\u547d\u4ee4\u65f6\uff0c\u8fd9\u6837\u53ef\u4ee5\u63d0\u9ad8\u751f\u4ea7\u7387\u3002<\/li>\n
  • \u5065\u5168\u7684\u811a\u672c\u80fd\u529b\uff1aFish \u907f\u514d\u4f7f\u7528\u90a3\u4e9b\u9690\u79d8\u5b57\u7b26\u3002\u8fd9\u63d0\u4f9b\u4e86\u66f4\u6e05\u6670\u548c\u66f4\u53cb\u597d\u7684\u8bed\u6cd5\u3002<\/li>\n
  • \u57fa\u4e8e\u624b\u518c\u9875\u7684\u8865\u5168\uff1aFish \u4f1a\u6839\u636e\u547d\u4ee4\u7684\u624b\u518c\u9875\u81ea\u52a8\u8865\u5168\u53c2\u6570\u3002<\/li>\n
  • \u8bed\u6cd5\u9ad8\u4eae\uff1aFish \u4f1a\u9ad8\u4eae\u663e\u793a\u547d\u4ee4\u8bed\u6cd5\u4ee5\u4f7f\u5176\u5728\u89c6\u89c9\u4e0a\u53cb\u597d\u3002<\/li>\n<\/ul>\n
    \u5b89\u88c5<\/strong><\/div>\n
    Fedora \u5de5\u4f5c\u7ad9<\/strong><\/span><\/div>\n

    \u4f7f\u7528\u00a0dnf\u00a0\u547d\u4ee4\u5b89\u88c5 fish\uff1a<\/p>\n

    $ sudo dnf install fish<\/pre>\n

    \u5b89\u88c5\u00a0util-linux-user\u00a0\u5305\uff0c\u7136\u540e\u4f7f\u7528\u9002\u5f53\u7684\u53c2\u6570\u8fd0\u884c\u00a0chsh\uff08\u66f4\u6539 shell \u7a0b\u5e8f\uff09\u547d\u4ee4\uff0c\u5c06 fish \u8bbe\u7f6e\u4e3a\u9ed8\u8ba4 shell \u7a0b\u5e8f\uff1a<\/p>\n

    $ sudo dnf install util-linux-user\r\n$ chsh -s \/usr\/bin\/fish<\/pre>\n

    \u4f60\u9700\u8981\u6ce8\u9500\u7136\u540e\u91cd\u65b0\u767b\u5f55\uff0c\u66f4\u6539\u624d\u80fd\u751f\u6548\u3002<\/p>\n

    Fedora Silverblue<\/strong><\/span><\/div>\n

    \u7531\u4e8e\u5b83\u4e0d\u662f GUI \u5e94\u7528\uff0c\u56e0\u6b64\u4f60\u9700\u8981\u4f7f\u7528\u00a0rpm-ostree\u00a0\u5c06\u5176\u52a0\u5230\u5c42\u5185\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728 Fedora Silverblue \u4e0a\u5b89\u88c5 fish\uff1a<\/p>\n

    $ rpm-ostree install fish<\/pre>\n

    \u5728 Fedora Silverblue \u4e0a\uff0c\u4f60\u9700\u8981\u91cd\u542f PC \u624d\u80fd\u5207\u6362\u5230\u65b0\u7684 ostree \u955c\u50cf\u3002<\/p>\n

    \u5982\u679c\u4f60\u60f3\u5728 Fedora Silverblue \u7528 fish \u4f5c\u4e3a\u4e3b\u8981 shell\uff0c\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u66f4\u65b0\u00a0\/etc\/passwd\u00a0\u6587\u4ef6\u3002\u627e\u5230\u4f60\u7684\u7528\u6237\uff0c\u5e76\u5c06\u00a0\/bin\/bash\u00a0\u66f4\u6539\u4e3a\u00a0\/usr\/bin\/fish\u3002<\/p>\n

    \u4f60\u9700\u8981\u00a0root \u6743\u9650\u6765\u7f16\u8f91\u00a0\/etc\/passwd\u00a0\u6587\u4ef6\u3002\u53e6\u5916\uff0c\u4f60\u9700\u8981\u6ce8\u9500\u5e76\u91cd\u65b0\u767b\u5f55\u624d\u80fd\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n

    \u914d\u7f6e<\/strong><\/div>\n

    fish \u7684\u7528\u6237\u914d\u7f6e\u6587\u4ef6\u5728\u00a0~\/.config\/fish\/config.fish\u3002\u8981\u66f4\u6539\u6240\u6709\u7528\u6237\u7684\u914d\u7f6e\uff0c\u8bf7\u7f16\u8f91\u00a0\/etc\/fish\/config.fish\u3002<\/p>\n

    \u7528\u6237\u914d\u7f6e\u6587\u4ef6\u5fc5\u987b\u624b\u52a8\u521b\u5efa\u3002\u5b89\u88c5\u811a\u672c\u4e0d\u4f1a\u521b\u5efa\u00a0~\/.config\/fish\/config.fish\u3002<\/p>\n

    \u4ee5\u4e0b\u662f\u4e24\u4e2a\u4e2a\u914d\u7f6e\u793a\u4f8b\u4ee5\u53ca\u5b83\u4eec\u7684 bash \u7b49\u6548\u9879\uff0c\u4ee5\u5e2e\u52a9\u4f60\u5165\u95e8\uff1a<\/p>\n

    \u521b\u5efa\u522b\u540d<\/strong><\/span><\/div>\n
    ~\/.bashrc\uff1aalias ll='ls -lh'\r\n~\/.config\/fish\/config.fish:\u00a0alias ll='ls -lh'<\/pre>\n
    \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/strong><\/span><\/div>\n
    ~\/.bashrc\uff1aexport PATH=$PATH:~\/bin\r\n~\/.config\/fish\/config.fish\uff1aset -gx PATH $PATH ~\/bin<\/pre>\n
    \u4f7f\u7528 fish \u5de5\u4f5c<\/strong><\/div>\n

    \u5c06 fish \u914d\u7f6e\u4e3a\u9ed8\u8ba4 shell \u7a0b\u5e8f\u540e\uff0c\u547d\u4ee4\u63d0\u793a\u7b26\u5c06\u7c7b\u4f3c\u4e8e\u4e0b\u56fe\u6240\u793a\u3002\u5982\u679c\u5c1a\u672a\u5c06 fish \u914d\u7f6e\u4e3a\u9ed8\u8ba4 shell\uff0c\u53ea\u9700\u8fd0\u884cfish\u547d\u4ee4\u4ee5\u5728\u5f53\u524d\u7ec8\u7aef\u4f1a\u8bdd\u4e2d\u542f\u52a8\u3002<\/p>\n

    \"\"<\/p>\n

    \u5728\u4f60\u5f00\u59cb\u8f93\u5165\u547d\u4ee4\u65f6\uff0c\u4f60\u4f1a\u6ce8\u610f\u5230\u8bed\u6cd5\u9ad8\u4eae\u663e\u793a\uff1a<\/p>\n

    \"\"<\/p>\n

    \u5f88\u9177\uff0c\u4e0d\u662f\u5417\uff1f<\/p>\n

    \u4f60\u8fd8\u5c06\u5728\u8f93\u5165\u65f6\u770b\u5230\u5efa\u8bae\u7684\u547d\u4ee4\u3002\u4f8b\u5982\uff0c\u518d\u6b21\u5f00\u59cb\u8f93\u5165\u4e0a\u4e00\u4e2a\u547d\u4ee4\uff1a<\/p>\n

    \"\"<\/p>\n

    \u6ce8\u610f\u8f93\u5165\u65f6\u51fa\u73b0\u7684\u7070\u8272\u6587\u672c\u3002\u7070\u8272\u6587\u672c\u663e\u793a\u5efa\u8bae\u4e4b\u524d\u7f16\u5199\u7684\u547d\u4ee4\u3002\u8981\u81ea\u52a8\u8865\u5168\uff0c\u53ea\u9700\u6309\u00a0CTRL+F\u3002<\/p>\n

    \u901a\u8fc7\u8f93\u5165\u8fde\u63a5\u53f7\uff08\u2013\uff09\u7136\u540e\u4f7f\u7528\u00a0TAB\u00a0\u952e\uff0c\u5b83\u4f1a\u6839\u636e\u524d\u9762\u547d\u4ee4\u7684\u624b\u518c\u9875\u83b7\u53d6\u53c2\u6570\u5efa\u8bae\uff1a<\/p>\n

    \"\"<\/p>\n

    \u5982\u679c\u4f60\u6309\u4e00\u6b21\u00a0TAB<\/code>\uff0c\u5b83\u5c06\u663e\u793a\u524d\u51e0\u4e2a\u5efa\u8bae\uff08\u6216\u6240\u6709\u5efa\u8bae\uff0c\u5982\u679c\u53ea\u6709\u5c11\u91cf\u53c2\u6570\u53ef\u7528\uff09\u3002\u5982\u679c\u518d\u6b21\u6309\u00a0TAB<\/code>\uff0c\u5b83\u5c06\u663e\u793a\u6240\u6709\u5efa\u8bae\u3002\u5982\u679c\u8fde\u7eed\u4e09\u6b21\u6309\u00a0TAB<\/code>\uff0c\u5b83\u5c06\u5207\u6362\u5230\u4ea4\u4e92\u6a21\u5f0f\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u7bad\u5934\u952e\u9009\u62e9\u4e00\u4e2a\u53c2\u6570\u3002<\/p>\n

    \u9664\u6b64\u4e4b\u5916\uff0cfish \u7684\u5de5\u4f5c\u4e0e\u5927\u591a\u6570\u5176\u4ed6 shell \u76f8\u4f3c\u3002\u5176\u4ed6\u5dee\u5f02\u5df2\u7ecf\u5199\u5728\u6587\u6863\u4e2d\u3002\u56e0\u6b64\uff0c\u627e\u5230\u4f60\u53ef\u80fd\u611f\u5174\u8da3\u7684\u5176\u4ed6\u529f\u80fd\u5e94\u8be5\u4e0d\u96be\u3002<\/p>\n

    \u8ba9 fish \u53d8\u5f97\u66f4\u5f3a\u5927<\/strong><\/div>\n

    \u4f7f\u7528\u00a0powerline\u00a0\u4f7f fish \u53d8\u5f97\u66f4\u5f3a\u5927\u3002Powerline \u53ef\u4ee5\u4e3a fish \u7684\u754c\u9762\u6dfb\u52a0\u547d\u4ee4\u6267\u884c\u65f6\u95f4\u3001\u5f69\u8272\u5316 git \u72b6\u6001\u3001\u5f53\u524d git \u5206\u652f\u7b49\u3002<\/p>\n

    \u5728\u5b89\u88c5 powerline \u4e4b\u524d\uff0c\u4f60\u5fc5\u987b\u5148\u5b89\u88c5\u00a0Oh My Fish\u3002Oh My Fish \u6269\u5c55\u4e86 fish \u7684\u6838\u5fc3\u57fa\u7840\u67b6\u6784\uff0c\u4ee5\u652f\u6301\u5b89\u88c5\u5176\u4ed6\u63d2\u4ef6\u3002\u5b89\u88c5 Oh My Fish \u7684\u6700\u7b80\u5355\u65b9\u6cd5\u662f\u4f7f\u7528\u00a0curl\u00a0\u547d\u4ee4\uff1a<\/p>\n

    curl -L https:\/\/get.oh-my.fish | fish\r\n<\/pre>\n

    \u5982\u679c\u4f60\u4e0d\u60f3\u76f4\u63a5\u5c06\u5b89\u88c5\u547d\u4ee4\u7ba1\u9053\u4f20\u7ed9\u00a0fish\uff0c\u8bf7\u53c2\u89c1 Oh My Fish \u7684\u00a0README\u00a0\u7684\u5b89\u88c5\u90e8\u5206\uff0c\u4ee5\u4e86\u89e3\u5176\u4ed6\u5b89\u88c5\u65b9\u6cd5\u3002
    \nFish \u7684 powerline \u63d2\u4ef6\u662f\u00a0bobthefish\u3002Bobthefish \u9700\u8981\u00a0powerline-fonts\u00a0\u5305\u3002<\/p>\n

    \u5728 Fedora \u5de5\u4f5c\u7ad9\u4e0a\uff1a<\/p>\n

    sudo dnf install powerline-fonts<\/pre>\n

    \u5728 Fedora Silverblue \u4e0a\uff1a<\/p>\n

    rpm-ostree install powerline-fonts<\/pre>\n

    \u5728 Fedora Silverblue \u4e0a\uff0c\u4f60\u5fc5\u987b\u91cd\u542f\u4ee5\u5b8c\u6210\u5b57\u4f53\u7684\u5b89\u88c5\u3002<\/p>\n

    \u5b89\u88c5powerline-fonts\u00a0\u4e4b\u540e\uff0c\u5b89\u88c5\u00a0bobthefish\uff1a<\/p>\n

    omf install bobthefish<\/pre>\n

    \u73b0\u5728\u4f60\u53ef\u4ee5\u901a\u8fc7 powerline \u4f53\u9a8c fish \u7684\u5168\u90e8\u5947\u5999\u4e4b\u5904\uff1a<\/p>\n

    \"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

    \u4f60\u662f\u5426\u6b63\u5728\u5bfb\u627e bash \u7684\u66ff\u4ee3\u54c1\uff1f\u4f60\u662f\u5426\u5728\u5bfb\u627e\u66f4\u4eba\u6027\u5316\u7684\u4e1c\u897f\uff1f\u4e0d\u7528\u518d\u770b\u4e86\uff0c\u56e0\u4e3a\u4f60\u521a\u53d1\u73b0\u4e86 fish\uff01 Fis […]<\/p>\n","protected":false},"author":323,"featured_media":173831,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-176368","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\/176368","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\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=176368"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/176368\/revisions"}],"predecessor-version":[{"id":176378,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/176368\/revisions\/176378"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/173831"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=176368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=176368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=176368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}