Simplifying Linux with … fish?
The primary reason is that fish isn’t generally installed by default. In fact, on some distributions, the repository that provides it is one your system probably doesn’t access. If you type “which fish” and your system responds simply with another prompt, you might be missing out on an interesting alternative shell. And if your apt-get or yum command can’t find what you’re looking for, you will probably have to use commands like those shown below to get fish loaded onto your system. On Ubuntu: –– ADVERTISEMENT –– The ppa:fish-shell repository contains regular builds of the most recent source for fish, built from the Git master trunk at https://github.com/fish-shell/fish-shell/. In case you’re not familiar with the term “PPA,” it stands for “Personal Package Archive” and is a software repository for source packages. On RHEL: If you’ve never have heard of “fish” related to Linux, you might be interested in knowing that it’s a shell that some refer to as “exotic.” One of its claims to notoriety is that it promises to be quie a bit friendlier than the older shells, such as bash. In fact, “fish” stands for “friendly interactive shell” and it promises to make it easier, especially for new Linux users, to remember and to execute commands. If you install fish and set up an account to use fish as its shell, you’ll notice right away that the command line prompt is a little different. Type a letter or two and you will notice that the shell attempts to guess what you want to do, suggesting what you might be trying to type. If you press a tab key, it will begin displaying a list of commands that start with the letter(s) you’ve typed so far. In the display below, only the “c” in “cd” has been typed and the tab key pressed. Note how the system responds by displaying a previously entered command. Press the tab again, and another screenload of possible commands will be displayed. Once the user has typed enough of a command to uniquely identify it, another press of the tab provides command completion. The user can then just press the enter key to run it. Another difference between fish and more conventional shells is that fish doesn’t use = signs to assign values to variables. To set up a variable, you need to use the set command. Note that fish’s disdain for the = sign doesn’t extend to things like configuring aliases (e.g., alias me=”whoami”). That’s the business of the alias command, after all, not the shell. You will also notice that the history file for this shell is buried a few directory levels in the user’s home directory. You can find it using ~/.local/share/fish/fish_history Another difference is that return codes from commands run in fish are not stored in $? as in bash, but in $status. As with other shells, 0 indicates success (no errors encountered). Any other value means that something went wrong. Another feature of fish that users might appreciate is that it allows them to select their screen colors, change their prompts, and view functions, variables, history, and key bindings on a web page using the fish_config command. The features that differentiate fish from other shells include: You’ll find that fish has a lot of features that make it worth investigating and may win over users who are a little intimidated by the Linux command line. You can learn more about fish at fishshell.com.
(CC BY-SA 2.0)$ sudo apt-add-repository ppa:fish-shell/release-2
$ sudo apt-get update
$ sudo apt-get install fish
$ cd /etc/yum.repos.d/
$ sudo wget https://download.opensuse.org/repositories/shells:fish:release:2/RHEL_7/shells:fish:release:2.repo
$ sudo yum install fish
What’s different about fish?
[email protected] ~>
[email protected] ~> cd .local
c++filt (Executable link, 26kB)
c89 (Executable link, 428B)
c89-gcc (Executable, 428B)
c99 (Executable link, 454B)
... and 94 more rows
[email protected] ~> TODAY=`date`
fish: Unsupported use of '='. In fish, please use 'set TODAY `date`'.
[email protected] ~> set TODAY `date`
[email protected] ~> echo hello
hello
[email protected] ~> echo $status
0
[email protected] ~> fish_config
How Fish is different from other shells
Learn more about fish