Check Shell Type Currently Use and Check Shell Version on Linux Fedora

 

   How to check current Shell type that you are in or currently use on Linux Fedora... and how to check the Shell version on Linux Fedora...  The article below show the step by step to check the current Shell that you use and how display the shell version on Linux Fedora 9. 

 

The command example below can be use to display the current Shell that you are in.

Check shell type on Linux Fedora

[root@fedora ~]# echo $SHELL

/bin/bash

[root@fedora ~]#

 

The command example below is use to display Shell version that is currently use, base on command above.

Check shell version on Linux Fedora

[root@fedora ~]# /bin/bash --version

GNU bash, version 3.2.33(1)-release (i386-redhat-linux-gnu)

Copyright (C) 2007 Free Software Foundation, Inc.

[root@fedora ~]#

 

Keywords: check shell, check shell type, check shell version

 

2 comments

14
Apr

Shows only default shell

Be careful, as far as I can determine the echo $SHELL does not tell you the actual shell in use, it only tells you the default shell. For example, if you put that command in a script which is invoked on a different shell, you will not see the ACTUAL shell used by the script.

Place hashpling/bin/tcsh at the beginning of a script with echo $SHELL in it and run the script from bash. It will report /bin/bash not /bin/tcsh.

28
Jul

Correct - Shows Only the $SHELL Environment Variable

Ray is correct - this only shows the $SHELL environment variable. You can check using the following commands ($ is terminal cursor):

$set | grep SHELL
SHELL=/bin/bash
$ ksh -c 'echo $SHELL'
/bin/bash

What you could try instead is the '$0' variable:

$ ksh -c 'echo $0'
ksh
aaron@zebrafish:~/oblivion/words$ echo $0
bash

'$0' is the name of the running process. See http://www.tldp.org/LDP/abs/html/othertypesv.html

aaaaaaaaaaa