different shells available in linux

What are the Different Shells Available in Linux

Shell provides an interactive environment for users to work with Linux operating system. Linux offers a number of popular shells to help you easily build and run programs. In this article, we will look at the different shells available in Linux.

Whenever user logs into Linux, they are provided with a shell environment to execute tools and commands. Shell provides a simple interface to interact with kernel, thereby allowing users to control computer operations, coordinate executing utilities, schedule and manage system processes.

Shell also provides a powerful user environment that allows them to search for commands, default permissions on files, find and set values for environment variables used by all programs, manage users, files, processes & tasks.


What are the Different Shells Available in Linux

Here are the different shells available in Linux.


1. Bourne Shell

Bourne shell is the default Unix shell, and in fact, the first shell. It is highly preferred for shell programming due to its speed and compactness. However, it lacks interactive features available in other shells, such as the history command that allows you to view previously executed commands. It also lacks arithmetic and logical expression handling.

It is present at /bin/sh and /sbin/sh, its default prompt is $ and root user’s default prompt #.


2. C Shell

It is a Bourne shell enhancement written by Bill Joy at UC Berkeley. It includes additional features such as aliases and command history. It also includes arithmetic expressions and expression syntax. It is located at /bin/csh, its non-root prompt is % and root prompt is #.


3. Korn Shell

Korn Shell includes everything offered by Bourne Shell and a lot more. It also includes interactive features supported by C Shell. It also includes in-built arithmetic, functions, string operations, and arrays. It is faster than C Shell and is capable of running all scripts written for Bourne Shell. It is located at /bin/ksh. Its non-root prompt is $ and root prompt is #.


4. Bash (Bourne Again Shell)

Bash shell is like an upgrade to Bourne Shell. It not only incorporates all features of Bourne shell but also interactivity of C Shell and Korn Shell. It even includes shortcuts to recall past commands and edit them.

It is located at /bin/bash with default prompt as bash-x.xx$ where x.xx is bash version. Root user is bash-x.xx#.

That’s it. As you can see there are many shells available in Linux. Out of them, bash is generally the most popular and preferred shell since it includes all features of Bourne shell, and most of the features from other 3 shells.

The default shell for each user in your system is stored in /etc/passwd file. Here is how to change default shell in Linux.

Also read:

How to Fix Permission Denied Error in Shell Script
How to Get Filename from Path in Shell Script
Shell Script to Trim Whitespace
How to Disable HTTP TRACE Method in Apache Server
How to Switch User in Ubuntu Linux

Leave a Reply

Your email address will not be published.