[SHELL] How to know in which shell you are working

[SHELL] How to know in which shell you are working

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 $$

Explanation:
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 particula 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.

Previous Microsoft Band 2 available for pre-orders in Australia
Next Idea 4G LTE launched in MP, Chhattisgarh, Haryana and Punjab

About author

siba 698 posts

A B.Tech degree holder with more than 5 years of experience on Embedded Systems design domain. He has worked on Aerospace domain, NAND storage, Server storage and Wireless networking.

View all posts by this author →

You might also like

Linux Guides 0 Comments

How to Unload a Module in Linux or Blacklist Module in Grub

Sometimes you need to unload a kernel module to load your own written code or you want to replace an out-of-box stock module to a vendor provided kernel module. Ir

Linux Guides 0 Comments

How to Create a USB Bootable Ubuntu Linux Live Disk

Looking to make a Live Ubuntu Linux USB disk? then you have arrived at the right place. Here I will provide you direct download link to the Ubuntu Linux ISO

Linux Guides 0 Comments

How to Learn Linux with an Online Linux Terminal

Are you looking for some online linux terminals to work with?? Yes, there are some Linux terminals available online which will be helpful for you to learn Linux on the

0 Comments

No Comments Yet!

You can be first to comment this post!