How to check current shell in Linux
Introduction
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.
From SHELL
echo $SHELL
From env
env |grep SHELL
$0
echo $0
ps
ps |grep $$
Conclusion
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
Disclaimer
- Welcome to visit the knowledge base of SRE and DevOps!
- License under CC BY-NC 4.0
- Made with Material for MkDocs and improve writing by generative AI tools
- Copyright issue feedback me#imzye.com, replace # with @