PUBLISHED: August 22, 2019
Deprecation Notice: This article was written more than a year ago which means that its information might no longer be up-to-date. We cannot therefore guarantee the accuracy of it's contents.

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.

-bash


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

Further Information

For further information on either the echo or ps commands, type:

$ man echo
...

$ man ps
...

See Also

How to sync files with lftp
How to sync files with lftp

How to mirror drives with rsync
How to mirror drives with rsync

How to install a Samsung ML-191x 252x Series printer with AirPrint support on a Raspberry Pi
How to install a Samsung ML-191x 252x Series printer with AirPrint support on a Raspberry Pi

Querying the Illuminates by Default attribute in Maya
Querying the Illuminates by Default attribute in Maya

Remove nodes from a set in Maya
Remove nodes from a set in Maya



comments powered by Disqus

See also