[手动选题][tech]: 20230118.2 ️ Beyond Bash 9 Lesser-Known Linux Shells and Their Capabilities.md

This commit is contained in:
六开箱 2023-01-29 00:14:43 +08:00
parent e3e5aacd0a
commit cb119ad82f

View File

@ -0,0 +1,346 @@
[#]: subject: "Beyond Bash: 9 Lesser-Known Linux Shells and Their Capabilities"
[#]: via: "https://itsfoss.com/shells-linux/"
[#]: author: "Sreenath https://itsfoss.com/author/sreenath/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Beyond Bash: 9 Lesser-Known Linux Shells and Their Capabilities
======
A Shell provides an interface to Linux and Unix-like systems by interpreting commands and acts as an intermediary between the user and the core workings of the operating system.
Undoubtedly, the **bash shell is the most popular one**, and some users prefer other shells like ZSH, which is the default shell in macOS. But many shells exist other than these popular ones, with different features and use cases.
In this article, we will take a look at some less popular shells that are actively maintained and provide a different user experience.
### 1. Fish Shell
When talking about shells other than bash/zsh, the first name coming to our mind is the fish shell.
Fish is a **smart, user-friendly command line shell** primarily for UNIX-like operating systems.
![fish shell][1]
**Features of Fish Shell**
- Autosuggestion of commands based on history and completions.
- Supports 24-bit color.
- It supports syntax highlighting, and all features work out of the box.
**Install Fish**
Fish is available in the official repos of almost all Linux distributions. In Ubuntu, you can install it by:
```
sudo apt install fish
```
The version in the Ubuntu repos is a bit old. If you want to install the latest version, you can use the official PPA provided by the team.
```
sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt install fish
```
[Fish Shell][2]
### 2. Nushell
Nushell is a new type of shell that works in **Linux, macOS, Windows, BSD**, etc. **Nu**, as its also called, it takes its philosophy and inspiration from projects like [PowerShell][3], functional programming languages, and modern [CLI][4] tools.
![nushell][5]
**Features of Nushell**
- **Everything is data:** Nu pipelines use structured data so you can safely select, filter, and sort the same way every time.
- **Powerful plugins:** It's easy to extend Nu using a powerful plugin system.
- **Easy to read error messages.** Nu operates on typed data, so it catches bugs that other shells dont. And when things break, Nu tells you exactly where and why.
- Clean IDE support.
**Install Nushell**
If youre on Ubuntu, you wont find an apt repository to install Nushell. But you can build it by installing the required dependencies, as per its [instructions on GitHub][6].
Fortunately, there is a way to install it on any distro using **Homebrew**. You can refer to our tutorial on [installing and using Homebrew Package Manager on Linux][7].
Once you successfully set it up on Linux, you need to type in the following command to install Nushell:
```
brew install nushell
```
Head to its official website to explore more installation options.
[Nushell][8]
### 3. Dune
The project's creator describes **Dune** as a shell by the beach. Dune is a **fast, useful and pretty shell**, offering a few niche metaprogramming features such as quoting.
![dune shell][9]
**Features of Dune Shell**
- Before entering the interactive mode, Dune executes _the prelude,_ a startup file stored in the home directory.
- Dune's REPL is entirely customizable
- You can define aliases by assigning a variable to a program's name
- Use a macro to write functions that modify your shell's environment and act like commands or programs
- Dune offers an extensive standard library and also provides a pretty interface to see all the functions available in each module.
**Install Dune Shell**
Dune shell is available in the Arch Linux repository as **dunesh**.
For all other users, the Dune shell can be installed with cargo. So first, you need to [install the latest version of rust][10]. If you already have rust installed, ensure you have the latest version and then proceed to install Dune.
```
cargo install -f dune
```
Once installed, you can access the shell by entering the following:
```
dunesh
```
[Dune Shell][11]
### 4. Xonsh
Xonsh is a **Python-powered, cross-platform shell** and command prompt. It combines Python and bash shell so that you can run Python commands directly in the shell. You can even combine Python and shell commands.
![xonsh shell][12]
We had a separate article on Xonsh if you are curious to learn more:
**Features of Xonsh Shell**
- The Xonsh language has shell primitives that you are used to from Bash
- Prepare environment variables and arguments in Python and use them in shell commands
- Xontribs is a 3rd-party extension system
- Customizable tab completion, key bindings, color styles
- Rich interface to discover history
**Installing Xonsh Shell**
Xonsh is available in the repos of many Linux distributions like Ubuntu, Fedora, etc. So, to install it on Ubuntu, run:
```
sudo apt install xonsh
```
Xonsh also provides an AppImage package, which can be downloaded from their download page. You may refer to our [AppImage guide][13] if you are new to the file format.
[Xonsh][14]
### 5. Hilbish
Hilbish is an **extensible shell** that is very customizable via the Lua programming language. The shell is aimed at both casual users and power users.
![hilbish shell][15]
Features of Hilbish
- Simple and Easy Scripting
- History and Completion Menus: Provides the user with proper menus for completions and history searching
- Syntax highlighting and hinting are available via the Lua API
- It works on Unix systems and Windows, but on Windows, there may encounter issues.
**Installing Hilbish**
Hilbish is not available in the package repositories of Ubuntu. So, you will be building it from the source.
To install it, you need **Go and task** installed.
```
sudo apt install golang-go
sudo snap install task --classic
```
Once the dependencies are installed, run the following commands to install Hilbish shell:
```
git clone --recursive https://github.com/Rosettea/Hilbish
cd Hilbish
go get -d ./...
```
If you want a stable branch, run these commands:
```
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
task build
sudo task install
```
[Hilbish][16]
### 6. Elvish
Elvish is an expressive programming language and a versatile interactive shell. It runs on Linux, Mac, and Windows. Even if **v1.0** has not been released, it is already suitable for most daily interactive use.
![elvish shell][17]
**Features of Elvish**
- **Powerful Pipelines:** Pipelines in Elvish can carry structured data, not just text. You can stream lists, maps, and even functions through the pipeline.
- **Intuitive Control Structures**
- **Directory History:** Elvish remembers all the directories you have been to. You can access it by pressing `CTRL+L`.
- **Command History**
- **Built-in File Manager:** Accessible by pressing CTRL + N
**Install Elvish**
Elvish shell is available in Ubuntu and Arch Linux package managers. So to install it, open a terminal and run:
```
sudo apt install elvish
```
[Elvish][18]
### 7. Oh
According to its developers, Oh is a reimagining of the Unix shell.
It aims to become a more powerful and robust replacement to modern options while respecting the conventions established by the Unix shell over the last half-century.
![][19]
**Features of Oh Shell**
- First-class channels, pipes, environments, and functions
- Rich return values that work with standard shell constructs
- Support for modularity.
- A simplified set of evaluation and quoting rules.
- A syntax that deviates as little as possible from established conventions;
**Installing Oh**
Oh provides a pre-compiled binary. You need to download it from their [official GitHub page][20].
You need to give execution permission to the file using the command:
```
chmod +x filename
```
Now, you can run it by :
```
./<name of binary file>
```
[Oh][21]
### 8. Solidity
Solidity is an interactive shell with lightweight session recording and remote compiler support. When you change the solidity pragma/language, it automatically fetches a matching remote compiler.
![][22]
**Features of Solidity**
- `pragma solidity <version>` attempts to dynamically load the selected compiler version
- Sessions can be saved and restored using the `.session`  command.
- Settings are saved on exit (not safe when running concurrent shells).
- `$_` is a placeholder for the last known result.
- Special commands are dot-prefixed. Everything else is evaluated as Solidity code.
**Install Solidity**
You can install solidity shell through npm.
[Ensure you have the latest version of nodejs][23] and npm installed, then type the following command:
```
npm install -g solidity-shell
```
Once installed, run **solidity-shell** to start the session.
[Solidity Shell][24]
### 9. Yash
Yash, or yet another shell is a POSIX-compliant command line shell written in C99 (ISO/IEC 9899:1999). It has features for daily interactive and scripting use.
![][25]
**Features of Yash Shell**
- Global aliases
- Socket redirection, pipeline redirection, and process redirection
- Prompt command and command-not-found handler
- Command line completion with predefined completion scripts for more than 100 commands
- Command line prediction based on command history
**Installing Yash Shell**
To install the shell, you need to go to their [GitHub releases][26] page and download the tar file. Now extract the tar file; inside it, you will find an INSTALL file with instructions to install it.
Typically, you should execute the below command inside the extracted folder.
```
./configure && make && sudo make install
```
[Yash][27]
### Honorable Mentions
- **Ion:** [Ion Shell][28] is a modern system shell written in Rust, primarily for **RedoxOS**. It is still a work in progress, and users should expect syntax changes.
- **Closh:** [Closh][29] is a bash-like shell that combines the best of traditional UNIX shells with the power of [Clojure][30]. It aims to be a modern alternative to bash. This, too, is in the early stages of development.
- **Dash**: [Dash][31] is a POSIX-compliant, fast and lightweight shell from Debian.
💬 _What do you think about these shells listed? Would you experiment by changing the default shell to some of the options here? What's your favorite one? Share your thoughts in the comments box below._
--------------------------------------------------------------------------------
via: https://itsfoss.com/shells-linux/
作者:[Sreenath][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://itsfoss.com/author/sreenath/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/content/images/2023/01/fish-shell.png
[2]: https://fishshell.com/
[3]: https://itsfoss.com/microsoft-open-sources-powershell/
[4]: https://itsfoss.com/gui-cli-tui/
[5]: https://itsfoss.com/content/images/2023/01/nushell.png
[6]: https://github.com/nushell/nushell
[7]: https://itsfoss.com/homebrew-linux/
[8]: https://www.nushell.sh/
[9]: https://itsfoss.com/content/images/2023/01/dunesh.png
[10]: https://itsfoss.com/install-rust-cargo-ubuntu-linux/
[11]: https://github.com/adam-mcdaniel/dune
[12]: https://itsfoss.com/content/images/2023/01/xonsh.png
[13]: https://itsfoss.com/use-appimage-linux/
[14]: https://xon.sh/
[15]: https://itsfoss.com/content/images/2023/01/hilbish.png
[16]: https://rosettea.github.io/Hilbish/
[17]: https://itsfoss.com/content/images/2023/01/elvish.png
[18]: https://elv.sh/
[19]: https://itsfoss.com/content/images/2023/01/oh_Shell.png
[20]: https://github.com/michaelmacinnis/oh#linux
[21]: https://github.com/michaelmacinnis/oh
[22]: https://itsfoss.com/content/images/2023/01/solidity-shell.png
[23]: https://itsfoss.com/install-nodejs-ubuntu/
[24]: https://github.com/tintinweb/solidity-shell
[25]: https://itsfoss.com/content/images/2023/01/yash.png
[26]: https://github.com/magicant/yash/releases/tag/2.53
[27]: https://yash.osdn.jp/index.html.en
[28]: https://gitlab.redox-os.org/redox-os/ion
[29]: https://github.com/dundalek/closh
[30]: https://clojure.org/
[31]: https://linuxhandbook.com/dash-shell/