Skip to content

How to check current shell in Linux



In Linux, a shell is a program that interprets and executes commands. It is the interface between the user and the operating system. There are various types of shells available in Linux, such as Bash, Zsh, Ksh, and many more. Each shell has its own set of features and functionalities. In this blog post, we will discuss how to check the current shell type in Linux.


echo $SHELL

From env

env |grep SHELL


echo $0


ps |grep $$ 


In conclusion, checking the current shell type in Linux is a simple task that can be done using the echo $SHELL command. Additionally, you can check the available shell types on your system using the cat /etc/shells command. Knowing the current shell type is essential for executing commands and scripts that are compatible with your shell.

Leave a message