List out all the Shells Using Linux Commands
Last Updated :
19 Apr, 2025
When you're operating out of a Linux environment, the shell is your primary tool for interacting with the OS. It's your command interpreter — it translates what you type into what the OS can interpret and carry out. From basic operations like looking at files to running complex scripts, the shell makes it all possible.
Linux can accommodate other shells beyond its default Bash shell, such as Zsh, Fish, and Dash. They each have different characteristics, performances, and customizability. Bash, for example, scripts robustly, Zsh has excellent auto-suggestions, whereas Fish is suited for beginners.
What Are Linux Shells
A shell in Linux is similar to your computer's "interpreter" – it takes your typed commands (like ls, cd, or mkdir) and interprets them for the operating system to execute. It's mostly how users interact with Linux systems through the command line interface (CLI). Some of the most widely used Linux shells are:
- Bash (Bourne Again Shell) – Most Linux distributions like Ubuntu, Debian, and Fedora's default shell.
- Zsh (Z Shell) – Smart autocompletion and default in macOS.
- Fish (Friendly Interactive Shell) – New, friendly shell with built-in help and syntax highlighting.
For More details refer Different Shells in Linux
In this it displays a list of all valid login shells available on your Linux system and also shows full shell paths like /bin/bash
, /usr/bin/zsh
, etc
Example:
cat /etc/shells
Using 'cat' commandThe 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.
It skips all the comment lines (starting with #
) in the /etc/shells
file and only shows the active shells that your system recognizes.
Example:
grep '^[^#]' /etc/shells
Using 'grep' commandMethod 3: Explore the /usr/bin/
Directory
It lists all files in /usr/bin/
ending with “sh and also helpful to see lesser-known shells like dash
, csh
, or any custom ones and also helpful for to see lesser-known shells like dash
, csh
, or any custom ones.
Example:
ls /usr/bin/ | grep 'sh$'
using /usr/bin/Method 4: Use which
to Check Specific Shells
It Tells you the exact installation path of each specified shell (if installed).
which bash zsh fish
using whichShell Comparison Table
Choosing the right shell can improve your productivity, script performance, and overall experience. While Bash is the most widely used shell, alternatives like Zsh, Fish, and Dash offer unique features and use cases.
Shell | Path | Default For | Key Feature |
---|
Bash | /bin/bash | Most Linux distros | Scripting power and POSIX compliance |
Zsh | /usr/bin/zsh | macOS (default shell) | Auto-suggestions, plugin support |
Fish | /usr/bin/fish | Not default on any major OS | User-friendly syntax, smart tab completion |
Dash | /usr/bin/dash | Ubuntu system scripts | Extremely lightweight and fast |
Conclusion
Knowing the various Linux shells that are running on your system puts you in control, flexible, and performing better. From cat /etc/shells to inquiring with which, each facilitates your knowing what shells are enabled and where they reside. Programs such as grep and viewing /usr/bin/ make it simple to look deeper.
Knowing the differences between shells such as Bash, Zsh, Fish, and Dash allows you to choose the appropriate one for your requirements — whether it's automation, usability, or performance. Knowing your environment is the first step towards being more productive on Linux.
Similar Reads
How to List all Users in the Mongo Shell
In MongoDB, user management is an essential aspect of database administration, allowing administrators to control access and permissions for different users. The Mongo Shell provides a powerful interface to interact with MongoDB including managing users. In this article, we'll explore how to list al
3 min read
How to Use Git Shell Commands?
Git is a powerful version control system that is important for managing source code in modern software development. While there are many graphical user interfaces (GUIs) available for Git, mastering Git shell commands can significantly enhance your productivity and control over your repositories. Th
3 min read
How to List All Collections in the MongoDB Shell?
Managing collections is a fundamental task in MongoDB database administration. Knowing how to list all collections in the MongoDB shell is essential for understanding your database structure and managing your data effectively. In this article, we'll explore how to list all collections in the MongoDB
3 min read
Basic Shell Commands in Linux: Complete List
Anyone using Linux should become an expert in the essential shell commands, as they form the backbone of working with the Linux terminal. These commands enable you to navigate the system, manage files, handle processes, and configure settings effectively.The Linux shell serves as an interface for us
5 min read
How to List Running Processes in Linux | ps Command
As we all know Linux is a multitasking and multi-user system. So, it allows multiple processes to operate simultaneously without interfering with each other. Process is one of the important fundamental concepts of the Linux OS. A process is an executing instance of a program that carries out differe
10 min read
Linux Security Command Cheat Sheet
Maintaining a secure and hardened Linux system is crucial in today's threat-laden digital landscape. This comprehensive Linux Security Command Cheat Sheet serves as an invaluable resource for system administrators and security professionals, providing a concise reference to essential commands spanni
7 min read
Linux Network Commands Cheat Sheet
Linux is a very popular operating system. Many people use it. Developers and network admins need to know Linux network commands well. This article will going explains most of the common Linux network commands in a very easy way and It also has a cheat sheet about these commands. The cheat sheet tell
9 min read
How to Access All Users in Linux Using Different Commands?
Linux allows multiple users with their own custom setting and configuration to work together on the same system, even at the same time. It can even allow a particular user to access several sessions from different locations in order to work on the system. Below is a list of different commands to acc
4 min read
How to List all Databases in the Mongo Shell?
Knowing how to list databases in MongoDB is an important part of managing your data effectively. By using basic MongoDB shell commands, you can easily see what databases you have and understand their sizes. By using commands such as show dbs and db.stats() and users can gain valuable insights into t
4 min read
Linux Commands Cheat Sheet
Linux, often associated with being a complex operating system primarily used by developers, may not necessarily fit that description entirely. While it can initially appear challenging for beginners, once you immerse yourself in the Linux world, you may find it difficult to return to your previous W
13 min read