How Do I Find My Linux Shell Name?

How Do I Find My Linux Shell Name?
Contents

How do I find my shell name?

To get the name of the current shell, Use cat /proc/$$/cmdline . And the path to the shell executable by readlink /proc/$$/exe . ps is the most reliable method. The SHELL environment variable is not guaranteed to be set and even if it is, it can be easily spoofed.

How do I know if I have bash or zsh?

Update your Terminal preferences to open the shell with the command /bin/bash , as shown in the screenshot above. Quit and restart Terminal. You should see “hello from bash”, but if you run echo $SHELL , you will see /bin/zsh .

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.