技术文章和资源

技术文章(时间排序)

热门类别

Python PHP MySQL JDBC Linux

Fish – 适用于 Linux 的智能且用户友好的交互式 Shell

unixpythonlinux

令人愉悦 交互式 Shell 被称为并缩写为 FISH,是适用于 UNIX 和类 UNIX 操作系统的 Shell。它是一个独特且创新的命令行环境,具有许多无价的改进。Fish 旨在与任何其他 Shell(如 bash 或 ZSH)配合使用。与其他默认禁用多个功能以节省进程资源的 shell 不同,FISH 默认启用所有功能,以便充分利用它。

功能

  • 它是一个用户友好且交互式的 shell
  • 它具有许多强大的功能
  • 内置基于 Web 的配置
  • 它支持华丽的 VGA 颜色和 256 种终端颜色
  • 支持 X 剪贴板
  • 错误检查功能
  • 帮助命令查看 FISH 文档
  • 使用箭头键选择建议

安装 FISH

要安装 fish,它需要 Python 软件属性,使用以下命令安装 python –

$ sudo apt-get install python-software-properties

示例输出应如下所示–

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
   python-pycurl
Suggested packages:
   libcurl4-gnutls-dev python-pycurl-dbg
The following NEW packages will be installed:
python-pycurl python-software-properties
0 upgraded, 2 newly installed, 0 to remove and 7 not upgraded.
Need to get 67.5 kB of archives.
After this operation, 358 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/main python-pycurl amd64 7.19.3-0ubuntu3 [47.9 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-software-properties all 0.92.37.7 [19.6 kB]
Fetched 67.5 kB in 1s (45.9 kB/s)
Selecting previously unselected package python-pycurl.
(Reading database ... 218616 files and directories currently installed.)
Preparing to unpack .../python-pycurl_7.19.3-0ubuntu3_amd64.deb ...
Unpacking python-pycurl (7.19.3-0ubuntu3) ...
....................................................

现在,我们应该调用 fish 存储库,如下所示-

$ sudo add-apt-repository ppa:fish-shell/nightly-master

输出应该是这样的 –

This repository contains regular builds of the most recent source of Fish shell, built from the Git master trunk at https://github.com/fish-shell/fish-shell/.

More info: https://launchpad.net/~fish-shell/+archive/ubuntu/nightly-master
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpzn3dsxqj/secring.gpg' created
gpg: keyring `/tmp/tmpzn3dsxqj/pubring.gpg' created
gpg: requesting key 6DC33CA5 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpzn3dsxqj/trustdb.gpg: trustdb created
gpg: key 6DC33CA5: public key "Launchpad PPA for Fish shell maintainers" imported
gpg: Total number processed: 1
gpg:             imported: 1 (RSA: 1)
OK

使用以下命令更新 Linux 软件包 –

$ sudo apt-get update

要安装 fish,请使用以下命令 –

$ sudo apt-get install fish

输出应如下所示 –

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
   linux-headers-4.2.0-27 linux-headers-4.2.0-27-generic
   linux-image-4.2.0-27-generic linux-image-extra-4.2.0-27-generic
   linux-signed-image-4.2.0-27-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
   xsel
The following NEW packages will be installed:
   fish xsel
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,187 kB of archives.
After this operation, 6,568 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/fish-shell/nightly-master/ubuntu/ trusty/main fish amd64 2.2.0-680-ga701264-1~trusty [1,166 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty/universe xsel amd64 1.2.0-2 [20.6 kB]
Fetched 1,187 kB in 4s (284 kB/s)
.................................

使用 Fish Shell

要使用 fish shell 命令行,请使用以下命令 –

$ fish

示例输出应如下所示 –

Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish

要检查已安装的 fish 版本,请使用以下命令 –

$ echo $FISH_VERSION

示例输出应如下所示 –

2.2.0-680-ga701264

要获得自动建议,只需输入"da",它将显示自动建议如下所示-

$ date

输出应如下所示 –

Tue Mar 15 11:29:50 IST 2016

要获取有关的更多信息,请使用以下命令 –

$ help

示例输出应如下所示 –

要实时自动获得智能颜色选择,请使用以下命令 –

$ echo
"I am loving tutorialspoint "

输出应如下所示 –

I am loving tutorialspoint

要将 fish  设为默认 shell,请使用以下命令 –

$ chsh -s /usr/bin/fish

要切换回之前的 shell,请使用以下命令 –

$ chsh -s /bin/bash

恭喜!现在,您知道了"如何使用 Fish - 适用于 Linux 的智能且用户友好的交互式 Shell"。我们将在下一篇 Linux 文章中详细了解这些类型的命令。请继续阅读!


相关文章