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
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
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.
- Different Shells in Linux
- How to Create Reverse Shells with Netcat in Kali Linux?
- How to Access All Users in Linux Using Different Commands?
- Daily life Linux Commands
- Basic Linux Commands for day to day life
- Network configuration and trouble shooting commands in Linux
- Important Linux Commands (leave, diff, cal, ncal, locate and ln)
- Essential Linux/Unix Commands
- Internal and External Commands in Linux
- Useful and time saving bash commands in Linux
- halt, poweroff and reboot Commands in Linux
- Custom commands for linux terminal
- Fun Commands in Linux
- Basic Shell Commands in Linux
- Linux Commands
- How to run Linux Commands on Windows 10?
- Interesting Funny Commands in Linux
- Linux vs Windows Commands
- How to Build Your Own Commands in Linux?
- How to find out where a function is defined using PHP ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.