Which Shell Am I Using? - ImagineLinux
Maybe your like
Shell is a command interpreter. It interprets the commands entered by you, runs against Unix/Linux Kernel, and provides the result on the standard output device. There are many shells developed since Unix came into existence.
Below is the list,
- Bourne Shell – sh
- C Shell – csh
- T Shell – tcsh
- Korn Shell – ksh
- Bourn-again Shell – bash
- Dash Shell
- Z shell
Oho… there are many. Which shell are you using?
In this article, we will provide a comprehensive guide to identify the shell in use.
Which Shell am I Using?
There are multiple method using which you can find out the shell you are using. We are covering 3 methods below.
Either should work for you, but you should know all.
1. /etc/passwd file
Unix creates all required configuration and setup when a user is created. Run grep <user> /etc/passwd to know the shell which you are using when you log in to Unix or Linux operating system.
Here, <user> – login user name.
The below example answers the question,grep imaginelinux /etc/passwd

Here, you are using Bourne – sh shell.
2. Another way is by using the $SHELL variable.
$SHELL variable is set with the default shell name as soon as you log in. Just display the content of the variable using the echo command to find out the default shell.echo $SHELL

You can also use $0 as well to find out shell. This is special variable and is set at shell initialization. It stores name of the shell.echo $0

3. ps -p $$
Another method is to use the ‘ps’ command with the ‘-p’ flag, followed by ‘$$’. This command will display information about the current shell’s process, including its name.ps -p $$

Now you know the shell. What if you want to change it?
That is also possible.
Linux provides ‘chsh’ (change shell) command that allows you to update the default shell for your user account. For example, to switch to Zsh, execute the following command:
chsh -s /bin/zshYou may need to log out and log back in for the changes to take effect.Summary
Different shells have different features, syntax, and built-in commands. Knowing your shell is essential for understanding its features and capabilities, as well as customizing your command-line experience. It also helps when looking up documentation or tutorials specific to your shell.
Just read below article go get more information on this topic.
- Which shell am I running on?
- How do I check which shell I am using?
You can learn more about shell by running man <shell name> command on terminal e.g man sh.
That’s it. I hope you liked this small tip.
Please share and like.
Tag » What Shell Am I Using
-
How Do I Find Out What Shell I Am Using On Linux/Unix? - NixCraft
-
How Do I Check Which Shell I Am Using? - Ask Ubuntu
-
Which Shell Am I Using? How Can I Switch? - Moncef Belyamani
-
Different Ways To Check Which Shell You Are Using On Linux
-
Determine The Current Shell In Linux - Baeldung
-
How To Find Which Shell I Am Using On Linux - Xmodulo
-
How To Determine The Current Interactive Shell That I'm In (command ...
-
What Shell Am I Using? Here's How To Find Out - OSXDaily
-
How To Find Which Shell Am I Using In Linux [4 Methods]
-
4 Ways To Check Which Shell You Are Using On Linux - LinuxOPsys
-
Bash - Which Shell Am I Running On? - Unix & Linux Stack Exchange
-
How To Tell What Shell Your Mac Is Using - Macinstruct
-
What Is The Linux Command To Find Out Which Shell You Are Using
-
How Do I Know If I Have Bash Or Zsh? - Linux Hint