Table of Contents
How to find out which shell I am running?
There are many different shells available on Linux based systems: bash, zsh, tcsh, csh, just to name a few. So how do we find out which shell we are currently in?
The echo command
Simple, we just execute a one-liner. As always, the first dollar $ symbol should be omitted because it is only a prompt indicating that we are logged in as a regular user.
$ echo $0
This gives us the following output which shows that we are in a bash shell.
The ps command
As always, there is more than one way to do the same thing in Linux:
$ ps -p $$
The ps command gives us slightly more output but it is still very easy to see which shell you are in.
PID TTY TIME CMD 27848 ttys002 0:01.72 -bash
For further information on either the echo or ps commands, type:
$ man echo ... $ man ps ...
comments powered by Disqus