In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
The main content of this article is "introduction to the method of using Fish Shell in Linux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "introduction to the method of using Fish Shell in Linux system".
Installation and configuration
Linux and OS X can basically be installed through the source, it is not difficult to download the source code to compile.
This is what Ubuntu says:
The code is as follows:
Sudo apt-get install fish
Enter fish from bash and enter fish directly.
The first step to install is to modify the OS default shell:
The code is as follows:
Chsh-s / usr/bin/fish
Then you can use it directly. It's as simple as that. You don't have to face a sea of zsh configuration files, and you don't need to github clone a "Oh My Zsh".
Of course, if you really want to configure it, typing the fish_config command will launch the web management interface.
What? The force box is too low and must be configured manually. OK, ~ / .config / fish/config.fish this is the configuration file for fish, similar to bash's .bashrc.
I like to configure three things:
1. Greeting (configure config.fish):
The code is as follows:
Set fish_greeting 'Talk is cheap. Show me the code.'
two。 Command line prompt (configured in the web interface, ~ / .config/fish/functions/fish_prompt.fish will be generated after completion):
3. Set the shortcut key to accept the suggestion (the third advantage):
Modify fish_prompt.fish by adding a statement: bind\ ej accept-autosuggestion. Press alt and j at the same time to accept the proposal.
advantage
Syntax highlighting
Commands that do not exist are displayed in red.
Wildcard character
Integrated find command, recursive search artifact.
Intelligent advice
After pressing a few letters, fish will have a smart suggestion, press the right arrow to accept the suggestion.
Tab completion
If there are more than 1 completion item, all of them will be listed for selection.
Variable
Fish uses set instead of "=" to assign values to variables.
Adding a directory to PATH also uses set (configure config.sh):
The code is as follows:
Set PATH $PATH / home/mountain/shell
Exports
Fish does not have an export command, so you need to use set-x instead. If you need to erase the variable, execute set-e.
List
Some variables have multiple values, such as $PATH,fish, which assembles all values into a list that can be iterated or accessed through subscripts.
Command replacement
The usage is simple, just put the command in parentheses.
Grammatical sugar
The common keywords of fish (if, switch, function, etc.) are much more high-end and practical than bash, but considering that it is impossible to install fish in the company's production environment, so the script can not be ported, so I can only give up this part.
At this point, I believe you have a deeper understanding of "introduction to the method of using Fish Shell in Linux system". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
File sharing service-Samba====Samba introduces ★ s
© 2024 shulou.com SLNews company. All rights reserved.