How to know the current shell you are logged in?


Indentify Active Shell
Indentify Active Shell

If you are using Linux or Unix Terminal and are not able to determine which shell are you currently active in, you can determine it by simply echoing $0 on the current prompt.

Examples:
b2391b608026# echo $0

zsh
root@b2391b608026:/# echo $0

bash
root@b2391b6026:/# echo $0

rbash
# echo $0

dash
# echo $0

sh

If you want to know the list of shells available on your Operating System, just cat /etc/shells

# /etc/shells: valid login shells
/bin/sh
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/rbash
/bin/dash
/usr/bin/dash
/bin/zsh
/usr/bin/zsh
Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap