[SHELL] How to know in which shell you are working in Linux or FreeBSD
There are several ways to know the current shell on which you are working. We will be using some shell commands to know in which Shell you are working on.
#1 To know Which Shell you are working on:
The easiest way is by entering the following command in the shell itself:
$ ps -p $$
Basically we are listing the process (by using the ps command) by process ID (the -p option to ps command) of the current process, which is the shell ($$). The ps command will report the PID of the current process and the name of the process.
#2 To know Which Shell you are working on:
You can also know the working shell by entering the following command in the shell itself:
$ echo $SHELL
This will give you the path to the current shell that you are using. Basically SHELL is a environment variable set when you run the command line or the Shell. This method may not work in some shells if the particular shell is not setting this variable.
If you know other ways to get the current shell then you are most welcome to share your knowledge.
You might also like
If you are looking to copy a directory in Linux using a command line, then here I have explained what command to use to copy a folder in Linux or
This post will tell you how to setup a network bridge in Ubuntu. I just cannot guarantee that this will work on all Ubuntu versions but this will surely work
Sometimes you wanted to change the Hostname on a Linux machine like on your Ubuntu PC or a Fedora machine or any other Linux distro like a Citrix XenServer to