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
Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
13 min read
Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
9 min read
What is Vacuum Circuit Breaker? A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac
13 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
Linux/Unix Tutorial Linux is one of the most widely used open-source operating systems. It's fast, secure, stable, and powers everything from smartphones and servers to cloud platforms and IoT devices. Linux is especially popular among developers, system administrators, and DevOps professionals.Linux is:A Unix-like OS
10 min read
Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca
7 min read
CTE in SQL In SQL, a Common Table Expression (CTE) is an essential tool for simplifying complex queries and making them more readable. By defining temporary result sets that can be referenced multiple times, a CTE in SQL allows developers to break down complicated logic into manageable parts. CTEs help with hi
6 min read