mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
[手动选题][tech]: 20230719.2 ⭐️⭐️ Linux Shells Bash, Zsh, and Fish Explained.md
This commit is contained in:
parent
4c8882394e
commit
dc42424cad
@ -0,0 +1,154 @@
|
||||
[#]: subject: "Linux Shells: Bash, Zsh, and Fish Explained"
|
||||
[#]: via: "https://www.debugpoint.com/linux-shells/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Linux Shells: Bash, Zsh, and Fish Explained
|
||||
======
|
||||
|
||||
**A few notes and features of famous Linux shells – Bash, Zsh and Fish.**
|
||||
|
||||
Linux is powerful because of its versatile command line interface to interact with the system. Central to this experience are the shells, which act as the bridge between users and the Linux kernel. This article will explore three popular Linux shells – Bash, Zsh, and Fish – and delve into their unique features and capabilities.
|
||||
|
||||
### Understanding Linux Shells
|
||||
|
||||
#### What is a Shell?
|
||||
|
||||
A shell is a command-line interpreter that allows you to interact with the OS through textual commands. It takes your input, processes it, and communicates with the Linux kernel to execute the requested actions. Finally, it gives you an output.
|
||||
|
||||
Shells play a crucial role in Linux because they enable users to perform various tasks, from simple file navigation to complex system administration tasks. Different shells offer various features, making it essential to choose the right one for your workflow.
|
||||
|
||||
### Bash
|
||||
|
||||
[Bash][1], short for “Bourne Again SHell,” is one of the most widely used and default shells in Linux distributions. It is known for its simplicity and compatibility, making it an excellent choice for beginners.
|
||||
|
||||
#### Features of Bash
|
||||
|
||||
Bash comes with a plethora of features, including:
|
||||
|
||||
- Command History: Easily access previously executed commands with the arrow keys.
|
||||
- Tab Completion: Save time by letting Bash complete filenames and commands for you.
|
||||
- Scripting: Write and run shell scripts to automate repetitive tasks. In that way, it’s also a program as well.
|
||||
- Bash is installed in most of the GNU/Linux systems by default.
|
||||
- Configuration settings are stored in `.bashrc` at your home directory.
|
||||
|
||||
Like any shell, Bash has its pros and cons. Some advantages of using Bash include its ubiquity, extensive documentation, and vast community support. However, Bash may lack some modern features found in other shells.
|
||||
|
||||
![Bash shell in Linux][2]
|
||||
|
||||
#### Installation
|
||||
|
||||
- Open the terminal in your Linux distribution.
|
||||
- Check if Bash is already installed by typing: `bash --version`.
|
||||
- If not installed, use your package manager to install Bash. For example, on Ubuntu, type: `sudo apt-get install bash`.
|
||||
- For Fedora and RPM-based Linux use `sudo dnf install bash`
|
||||
|
||||
### Zsh
|
||||
|
||||
[Zsh][3], short for “Z Shell,” is a robust, feature-rich shell popular among experienced users. It takes the best from Bash and other shells, enhancing the user experience.
|
||||
|
||||
#### Advantages of Zsh
|
||||
|
||||
Zsh offers several advantages, such as:
|
||||
|
||||
- Advanced Auto-Completion: Zsh goes beyond Bash’s tab completion, providing more context-aware suggestions.
|
||||
- When you press the tab, Zsh also shows you possible values alongside the auto-completion.
|
||||
- Plugin Support: Extend Zsh’s functionality through various plugins available in the community.
|
||||
- Here’s a list of a [vast collection of Zsh themes][4].
|
||||
- You can also enjoy extensive customizations using [Oh My Zsh script][5].
|
||||
|
||||
![After applying settings in powerlevel10k zsh theme][6]
|
||||
|
||||
Zsh’s complexity may overwhelm newcomers, and its extensive configuration options might confuse beginners.
|
||||
|
||||
Here’s how to install it.
|
||||
|
||||
- Open the terminal in your Linux distribution.
|
||||
- Check if Zsh is installed by typing: zsh –version.
|
||||
- If not installed, use your package manager to install Zsh.
|
||||
- For example, on Ubuntu, type: `sudo apt-get install zsh`.
|
||||
- For Fedora and RPM-based distributions, type: `sudo dnf install zsh`.
|
||||
|
||||
### Fish Shell
|
||||
|
||||
[Fish][7], the “Friendly Interactive SHell,” focuses on user-friendliness and discoverability. It has a modern, straightforward interface that appeals to new Linux users.
|
||||
|
||||
#### Unique Features of Fish
|
||||
|
||||
Fish stands out with its:
|
||||
|
||||
- Syntax Highlighting: Use colour-coded text to distinguish between commands, options, and arguments.
|
||||
- Autosuggestions: Fish intelligently suggests commands based on your history and current input.
|
||||
- Fish is designed to work efficiently out of the box. However, you can personalize it further by creating the `~/.config/fish/config.fish` file and adding custom configurations.
|
||||
|
||||
While Fish excels in user-friendliness, its unique approach might not suit everyone. Some power users might find certain features limiting for advanced use.
|
||||
|
||||
![Fish Shell][8]
|
||||
|
||||
#### Fish Shell Installation
|
||||
|
||||
- Open the terminal in your Linux distribution.
|
||||
- Check if Fish is installed by typing: `fish --version`.
|
||||
- If not installed, use your package manager to install Fish. For example, on Ubuntu, type: `sudo apt-get install fish`.
|
||||
- For Fedora and other RPM-based distributions type: `sudo dnf install fish`.
|
||||
|
||||
### Comparison of Bash, Zsh, and Fish
|
||||
|
||||
To help you decide which shell fits your needs, let’s compare these three popular choices in various aspects:
|
||||
|
||||
#### Performance and Speed
|
||||
|
||||
Bash is known for its speed and efficiency, making it an excellent choice for resource-constrained systems. Zsh, while slightly slower, makes up for it with its extensive features and capabilities. Being more interactive, Fish shell might have a slight performance overhead but provides a delightful user experience.
|
||||
|
||||
#### User Interface and Experience
|
||||
|
||||
Bash’s interface is simple and straightforward, ideal for beginners, while Zsh and Fish offer more eye-catching and interactive interfaces. Zsh’s advanced auto-completion and Fish’s syntax highlighting create a visually appealing experience.
|
||||
|
||||
#### Customizability and Plugins
|
||||
|
||||
Zsh shines in customizability, allowing users to fine-tune their shell environment. With a vast collection of plugins, Zsh offers unparalleled extensibility. Fish takes a more opinionated approach, focusing on out-of-the-box usability, which might be limiting for some users.
|
||||
|
||||
### Choosing the Right Shell
|
||||
|
||||
The choice of the right shell largely depends on your specific needs and level of experience.
|
||||
|
||||
Bash is an excellent starting point if you are new to Linux and prefer a straightforward, no-frills experience. Its ease of use and extensive documentation make it beginner-friendly.
|
||||
|
||||
For experienced users who want more control and are willing to invest time in customization, Zsh’s powerful features and plugins offer an exciting and dynamic environment.
|
||||
|
||||
If you’re interested in automating tasks and writing complex shell scripts, Bash’s wide adoption and extensive support in the Linux ecosystem make it a reliable choice.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Bash, Zsh, and Fish each have their strengths and cater to different user preferences. If you’re new to Linux, Bash’s simplicity makes it an excellent starting point. Power users and those seeking customization may find Zsh more appealing, while Fish’s user-friendly design suits beginners looking for an intuitive interface. Ultimately, the choice is yours, and exploring these shells will lead to a more efficient and enjoyable Linux experience.
|
||||
|
||||
What is your favourite Shell? Let me know in the comment box below.
|
||||
|
||||
_Feature Image by [julia roman][9] from Pixabay._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/linux-shells/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://www.gnu.org/software/bash/
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2023/07/Bash-shell-in-Linux.jpg
|
||||
[3]: https://www.zsh.org/
|
||||
[4]: https://github.com/unixorn/awesome-zsh-plugins
|
||||
[5]: https://www.debugpoint.com/oh-my-zsh-powerlevel10k/
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2022/12/After-applying-settings-in-powerlevel10k-zsh-theme.jpg
|
||||
[7]: https://fishshell.com/
|
||||
[8]: https://www.debugpoint.com/wp-content/uploads/2023/07/Fish-Shell.jpg
|
||||
[9]: https://pixabay.com/users/julesroman-359800/
|
Loading…
Reference in New Issue
Block a user