22
Dec

Determine Which Terminal Shell You’re Running

It’s very simply to determine which shell you’re using while logged into a Linux terminal.  Simply run the following command:

ps -p $$ | tail -n1 | cut -d" " -f26

You’ll get in return, the shell command you’re using (plus the full path to it).

[email protected]$ ps -p $$ | tail -n1 | cut -d" " -f26
/usr/bin/bash

Another way to do it would be to use awk instead of cut:

ps -p $$ | tail -n1 | awk '{print $NF}'

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:


There's 2 Comments So Far

Share your thoughts, leave a comment!