Skip to content
Related Articles

Related Articles

List out all the Shells Using Linux Commands

View Discussion
Improve Article
Save Article
  • Last Updated : 22 Jun, 2020

There are various methods to list all the shells which are installed in our Linux system. A Shell is a software program that acts as an interface between the user and the operating system(OS). It can also be thought of as a command interpreter that is used to execute another program.

Method 1: Using cat command


cat /etc/shells
using cat command to find the shells in Linux

Using ‘cat’ command

Explanation: The list of all the shells which are currently installed in our Linux system is stored in the ‘shells’ file which is present in /etc folder of the system. It has read-only access by default and is modified automatically whenever we install a new shell in our system. As we can see, the cat command displays the various installed shells along with their installation paths.

Method 2: Use of grep command with Regular Expressions.


grep '^[^#]' /etc/shells
using grep command to find shells in Linux

Using ‘grep’ command

Explanation: Regular Expressions are one of the most powerful tools that come in handy when handling complex expressions. We can use regular expressions with grep command to display all the shells installed in our system as shown above.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!