Overview
In this lesson, we will study the types of shells available in Linux and what advantages one shell offers over another. Shells are not always helpful and one shell can be much better than another as evolution of shells is ongoing. Let’s study about shells in detail now.
What are shells?
A shell is an interpreter where we can provide commands and get a response. Shells can perform powerful and uncountable number of actions based on the commands we provide. Basically, a Shell is a program which runs other programs.
Let’s look at a quick peek on the type of shells here:
It all began at Bell Labs when Thompson Shell released first shell environment. From then, shells have always evolved.
Types of Shells
Let’s study different kind of shells with their features, functionalities and speed of executions.
Bash Shell
Bash is a Unix shell. It was created as a substitute for Bourne shell and include much more scripting tools than Bourne shell like the csh and ksh shells.
Bash is a very common shell and you actually might be running it by default on your machine. It is almost always available on all Linux distributions. One of the contender to Bash shell is dash which is becoming more popular by the Ubuntu project.
Zsh Shell
Zsh shell is 100% compatible with bash. This means that whatever scripts run on Bash runs on Zsh shell exactly the same. To add, Zsh shell includes more features.
Most common features in Zsh shell are spelling correction, intelligent command-line completion, pluggable modules that increase shell capabilities, aliases with global access that allow a user to alias file names or anything else instead of just commands and much better theming support.
Even better feature in favor of Zsh shell is that if a user is known to Bash shell, it is very easy to switch to Zsh shell without getting used to a different syntax.
Csh Shell
Csh is an improved C shell. It is most popular in terms of a login shell and shell command interpreter. Most favorable features of this shell are:
- Syntax similar to C
- Control over jobs
- Intelligent spell correction
- Command-line editor
- Filename completion
Why Csh is not highly recommended?
The only (and big) problem with Csh shells are that they can create many issues when it comes to Scripting.
There might not be any exact reasons on why you shouldn’t use it as an interactive shell. Usually, a user will find its use a little confusing as you need to learn to use different shells. It is always better to use a single shell when you are doing many things at once.
More shells
The other candidates for interactive shells are dash, ksh and zsh shells. All of these shells follow the posix standards with some extra features. My personal favorite has always been the bash shell.
Conclusion
We studied some most popular Linux shells and recommend one of them which offers the most features. It is always a pick related to personal preference. Tweet us your favorite shell @linuxhint.