如何在 Linux 上安装友好的交互式 shell:Fish

找不到分类 evilven 2个月前 (03-15) 31次浏览 未收录 0个评论 扫描二维码
如何在 Linux 上安装友好的交互式 shell:Fish

Fish 有着很多重要的功能,比如自动建议、语法高亮、可搜索的历史记录(像在 bash 中 CTRL+r)、智能搜索功能、极好的 VGA 颜色支持、基于 web 的设置方式、完善的手册页和许多开箱即用的功能。
— Sk


本文导航
编译自 | https://www.ostechnix.com/install-fish-friendly-interactive-shell-linux/ 
 作者 | Sk
 译者 | kimii

Fish,友好的交互式 shellFriendly Interactive SHell 的缩写,它是一个适于装备于类 Unix 系统的智能而用户友好的 shell。Fish 有着很多重要的功能,比如自动建议、语法高亮、可搜索的历史记录(像在 bash 中 CTRL+r)、智能搜索功能、极好的 VGA 颜色支持、基于 web 的设置方式、完善的手册页和许多开箱即用的功能。尽管安装并立即使用它吧。无需更多其他配置,你也不需要安装任何额外的附加组件/插件!

在这篇教程中,我们讨论如何在 Linux 中安装和使用 fish shell。

安装 Fish

尽管 fish 是一个非常用户友好的并且功能丰富的 shell,但并没有包括在大多数 Linux 发行版的默认仓库中。它只能在少数 Linux 发行版中的官方仓库中找到,如 Arch Linux,Gentoo,NixOS,和 Ubuntu 等。然而,安装 fish 并不难。

在 Arch Linux 和它的衍生版上,运行以下命令来安装它。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> pacman </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">S fish</span></code></p></li></ol>

在 CentOS 7 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">cd</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">etc</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">yum</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">repos</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">d</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">wget</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish:release:2.repo</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">yum</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> install fish</span></code></p></li>
</ol>

在 CentOS 6 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">cd</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">etc</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">yum</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">repos</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">d</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">wget</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/CentOS_6/shells:fish:release:2.repo</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">yum</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> install fish</span></code></p></li>
</ol>

在 Debian 9 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">wget</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">nv https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/Debian_9.0/Release.key -O Release.key</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">apt</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">key add </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);"><</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Release</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">key</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">echo</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">'deb http://download.opensuse.org/repositories/shells:/fish:/release:/2/Debian_9.0/ /'</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">></span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">/etc/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">apt</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">sources</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">list</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">d</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">fish</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">list</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> update</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> install fish</span></code></p></li>
</ol>

在 Debian 8 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">wget</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">nv https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/Debian_8.0/Release.key -O Release.key</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">apt</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">key add </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);"><</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Release</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">key</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">echo</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">'deb http://download.opensuse.org/repositories/shells:/fish:/release:/2/Debian_8.0/ /'</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">></span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">/etc/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">apt</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">sources</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">list</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">d</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">fish</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">list</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> update</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> install fish</span></code></p></li>
</ol>

在 Fedora 26 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dnf config</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">manager </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">--</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">add</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">repo https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/Fedora_26/shells:fish:release:2.repo</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dnf install fish</span></code></p></li>
</ol>

在 Fedora 25 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dnf config</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">manager </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">--</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">add</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">repo https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/Fedora_25/shells:fish:release:2.repo</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dnf install fish</span></code></p></li>
</ol>

在 Fedora 24 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dnf config</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">manager </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">--</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">add</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">repo https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/Fedora_24/shells:fish:release:2.repo</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dnf install fish</span></code></p></li>
</ol>

在 Fedora 23 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dnf config</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">manager </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">--</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">add</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">repo https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/Fedora_23/shells:fish:release:2.repo</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dnf install fish</span></code></p></li>
</ol>

在 openSUSE 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">zypper install fish</span></code></p></li></ol>

在 RHEL 7 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">cd</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">etc</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">yum</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">repos</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">d</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">wget</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/RHEL_7/shells:fish:release:2.repo</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">yum</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> install fish</span></code></p></li>
</ol>

在 RHEL-6 上以 root 运行以下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">cd</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">etc</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">yum</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">repos</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">d</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">wget</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> https</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">//download.opensuse.org/repositories/shells:fish:release:2/RedHat_RHEL-6/shells:fish:release:2.repo</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">yum</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> install fish</span></code></p></li>
</ol>

在 Ubuntu 和它的衍生版上:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> update</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> install fish</span></code></p></li>
</ol>

就这样了。是时候探索 fish shell 了。

用法

要从你默认的 shell 切换到 fish,请执行以下操作:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">$ fish</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Welcome</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> to fish</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> the friendly interactive shell</span></code></p></li>
</ol>

你可以在 ~/.config/fish/config.fish 上找到默认的 fish 配置(类似于 .bashrc)。如果它不存在,就创建它吧。

自动建议

当我输入一个命令,它以浅灰色自动建议一个命令。所以,我需要输入一个 Linux 命令的前几个字母,然后按下 tab 键来完成这个命令。

如何在 Linux 上安装友好的交互式 shell:Fish

如果有更多的可能性,它将会列出它们。你可以使用上/下箭头键从列表中选择列出的命令。在选择你想运行的命令后,只需按下右箭头键,然后按下 ENTER 运行它。

如何在 Linux 上安装友好的交互式 shell:Fish

无需 CTRL+r 了!正如你已知道的,我们通过按 CTRL+r 来反向搜索 Bash shell 中的历史命令。但在 fish shell 中是没有必要的。由于它有自动建议功能,只需输入命令的前几个字母,然后从历史记录中选择已经执行的命令。很酷,是吧。

智能搜索

我们也可以使用智能搜索来查找一个特定的命令、文件或者目录。例如,我输入一个命令的一部分,然后按向下箭头键进行智能搜索,再次输入一个字母来从列表中选择所需的命令。

如何在 Linux 上安装友好的交互式 shell:Fish

语法高亮

当你输入一个命令时,你将注意到语法高亮。请看下面当我在 Bash shell 和 fish shell 中输入相同的命令时截图的区别。

Bash:

如何在 Linux 上安装友好的交互式 shell:Fish

Fish:

如何在 Linux 上安装友好的交互式 shell:Fish

正如你所看到的,sudo 在 fish shell 中已经被高亮显示。此外,默认情况下它将以红色显示无效命令。

基于 web 的配置方式

这是 fish shell 另一个很酷的功能。我们可以设置我们的颜色、更改 fish 提示符,并从网页上查看所有功能、变量、历史记录、键绑定。

启动 web 配置接口,只需输入:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">fish_config</span></code></p></li></ol>

如何在 Linux 上安装友好的交互式 shell:Fish

手册页补完

Bash 和 其它 shells 支持可编程的补完,但只有 fish 可以通过解析已安装的手册来自动生成它们。

为此,请运行:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">fish_update_completions</span></code></p></li></ol>

实例输出将是:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Parsing</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">man</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> pages </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">and</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> writing completions to </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">home</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">sk</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/.</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">local</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">share</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">fish</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">generated_completions</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">3435</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">3435</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> zramctl</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">8.gz</span></code></p></li>
</ol>

禁用问候语

默认情况下,fish 在启动时问候你(“Welcome to fish, the friendly interactive shell”)。如果你不想要这个问候消息,可以禁用它。为此,编辑 fish 配置文件:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">vi</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">~</span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">/.config/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">fish</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">config</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">fish</span></code></p></li></ol>

添加以下行:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">set</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">g </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">x fish_greeting </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">''</span></code></p></li></ol>

你也可以设置任意自定义的问候语,而不是禁用 fish 问候。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">set</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">g </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">x fish_greeting </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">'Welcome to OSTechNix'</span></code></p></li></ol>

获得帮助

这是另一个吸引我的令人印象深刻的功能。要在终端的默认 web 浏览器中打开 fish 文档页面,只需输入:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">help</span></code></p></li></ol>

官方文档将会在你的默认浏览器中打开。另外,你可以使用手册页来显示任何命令的帮助部分。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">man</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> fish</span></code></p></li></ol>

设置 fish 为默认 shell

非常喜欢它?太好了!设置它作为默认 shell 吧。为此,请使用命令 chsh

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">chsh</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">s </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">usr</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">bin</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">fish</span></code></p></li></ol>

在这里,/usr/bin/fish 是 fish shell 的路径。如果你不知道正确的路径,以下命令将会帮助你:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">which fish</span></code></p></li></ol>

注销并且重新登录以使用新的默认 shell。

请记住,为 Bash 编写的许多 shell 脚本可能不完全兼容 fish。

要切换回 Bash,只需运行:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">bash</span></code></p></li></ol>

如果你想 Bash 作为你的永久默认 shell,运行:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">chsh</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">s </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">bin</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">bash</span></code></p></li></ol>

各位,这就是全部了。在这个阶段,你可能会得到一个有关 fish shell 使用的基本概念。 如果你正在寻找一个Bash的替代品,fish 可能是一个不错的选择。

Cheers!

资源:

◈ fish shell 官网[1]

via: https://www.ostechnix.com/install-fish-friendly-interactive-shell-linux/

作者:SK[3] 译者:kimii 校对:wxy

本文由 LCTT 原创编译,Linux中国 荣誉推出

LCTT 译者
如何在 Linux 上安装友好的交互式 shell:Fish

kimii 🌟 🌟
共计翻译:2 篇
贡献时间:12 天


推荐文章

< 左右滑动查看相关文章 >

如何在 Linux 上安装友好的交互式 shell:Fish如何在 Linux 上安装友好的交互式 shell:Fish如何在 Linux 上安装友好的交互式 shell:Fish如何在 Linux 上安装友好的交互式 shell:Fish如何在 Linux 上安装友好的交互式 shell:Fish如何在 Linux 上安装友好的交互式 shell:Fish如何在 Linux 上安装友好的交互式 shell:Fish如何在 Linux 上安装友好的交互式 shell:Fish

点击图片、输入文章 ID 或识别二维码直达


Hacking For Fun , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何在 Linux 上安装友好的交互式 shell:Fish
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址