The UNIX/Linux shell is a command-line program that creates a bridge between the terminal emulator and kernel to allow users to enter commands, execute programs, and perform various other tasks by typing commands at the command prompt.
Once the shell has finished executing the user assigned program, it will send the output to the user on the terminal screen, which is the standard output device.
Note that the shell is not just a program but a whole programming language like Python or C/C++. You can write your own program, utility, or script that contains the if-else logic, loop statement, functions, variables, object, etc.
Most users are familiar with the Bash shell (the successor to the traditional “sh“), but there are many other shell implementation programs that provide different features and functionality, which we will explore in this article.
Different Types of Linux Shells
The shell, or sh (also known as Bourne Shell), is the first POSIX standard shell used as the default login shell for UNIX and GNU/Linux.
Although, it was a specification (lacking many features), not an implementation, that is why you will find many implementations of it, starting with:
1. GNU Bourne-Again Shell (Bash)
Bash, an acronym for “Bourne-Again SHell“, is a superset of the shell (or sh) program written by Brian Fox for the GNU Project in 1979 as a replacement for the traditional Bourne Shell (or sh).
Also Read: What is Bash Shell in Linux?
Today, most of the Linux distributions ship Bash as the default login shell, which offers functional improvements over Bourne Shell (or sh) for both programming and interactive uses.
The following is a list of highlighted features introduced by the Bash shell:
- Job control
- Support for Array
- Filename Globbing
- Piping and directory manipulation
- Shell Functions and Aliases
- Dynamic scope variables
- Unlimited Indexed arrays size
- Unlimited command history size
- Integer arithmetic in any base from two to sixty-four
The Bash prompt for a normal user switches to “$“, while the root prompt is “#“.
You may also hear the term “restricted bash” (or “rbash”), which is nothing more than a bash with restrictions. For more information, see this article.
2. Dash shell
Dash (or the Debian Almquist shell) is a UNIX/Linux shell that complies with the POSIX standard and earned the title of “lightest shell” (10x smaller in size) compared to Bash.
Also Read: What is Dash (/bin/dash) Shell in Linux?
It is a direct descendant of the Almquist shell (also known as A shell, ash, and sh), which was ported from NetBSD to Debian/Ubuntu Linux in late 1997 by Herbert Xu.
The following is a list of known features of Dash:
- 4 times faster than Bash or other shells
- Increase the speed of system boot time
- Require minimal disk space, CPU, and RAM compared to alternatives
- More reliable with an upgrade problem or broken system.
The Dash prompt for a normal user switches to “$“, while the root prompt is “#“.
3. Tcsh/Csh Shell
The C shell (or CSH) is one of the earliest UNIX/Linux shell interpreters, developed by Bill Joy at the University of California, Berkeley, in the late 1970s, inspired by the C programming language.
On systems like macOS or Red Hat, instead of C shell, you will find its extended version, Tcsh (also known as “tee-see-shell” or “tee-shell“), as a symbolic link pointing towards its original source.
The “t” in “tcsh” comes from the “T” in the TENEX operating system, and many features were taken from this OS as inspiration by the author of Tcsh while studying at Carnegie Mellon University.
The following is a list of known features:
- C-like syntax
- Job control
- Command-line editor
- Spelling correction
- History substitutions
- Job control facilities
- Interactive filename and command completion
- Support shell script execution
- Backward compatible with the C shell
The Tcsh prompt for a normal user switches to “>“, while the root prompt is “#“.
4. Korn Shell (KSH)
Korn shell (or KSH) is a POSIX 2 compliant UNIX shell developed by David Korn at Bell Labs in the late 1980s, much earlier than Bash shell.
Its development goal was to inherit all the features of C shell (csh) and Tab C-shell (tcsh), including scripting and loop handling, which are identical to Bourne shell.
Unlike the echo command in Bash used to print messages in the terminal, it uses the print command (considered better than echo) to do the same job.
The following are known features of the Ksh shell:
- Object-oriented programming
- Extensibility of built-in commands
- Backward compatible with the Bourne shell
- Faster then the C shell and Bourne shell
- Built-in mathematical functions and floating-point arithmetic
The KSH prompt for a normal user switches to “$“, while the root prompt is “#“.
5. Z Shell (ZSH)
The ZSH (or Z shell) can be said to be an extended version of the standard Bash shell interpreter, written by Paul Falstad in 1990 while studying at Princeton University.
Also Read: How to Install Zsh (with Oh-My-Zsh) in Linux
It inherits all the Bash features and provides its own notable features, followed by:
- Auto command completion
- Command suggestion
- Syntax highlighting
- Filename generation
- Login/Logout watching
- Sharing command history
- Extensibility through plugins
- Improved shell array and variable handling
The ZSH prompt for a normal user switches to “%“, while the root prompt is “#“.
6. Friendly Interactive Shell (Fish)
Fish is a UNIX/Linux shell program that is easy to use and focuses on giving you most of the common features by default, without having to set them up yourself.
Also Read: How to Install Fish Shell (with Starship) in Linux
The following are known features of the Fish shell:
- Tab Completion
- Syntax highlighting
- Alluring UI
- Easy Scripting
- Web-based Configuration
- Support for Term256 terminal technology
- Command history with search options
The Fish prompt for a normal user switches to “>“, while the root prompt is “#“.
And here comes the end of this list.
This article gives you a good view of the different types of shell programs in Linux. However, I strongly advise you to read the following source to learn more about the Linux shell.
What is Interactive Login and Non-Login Shell
What is Shebang (#! /bin/bash) in Linux Shell Script
What is Exit Status Code ($?) of Last Command in Linux
Listing All the Available Shells in Your Linux System
That’s all for now in this article; if you have any questions or queries, or even any known shells that are not mentioned in this article, then let us know in the comment section.
Till then, peace!
Join The Conversation
Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.