Contact us

Print

Switching between the different shells


Exercise 1


Switching between the different shells


Your “default” interactive shell is stored in an environmental variable named “SHELL” and the “current” interactive shell is stored in another variable, named “$0”

To Find what shell you are working in


1. Log in to the computer as root
2. Type:


[root@localhost root]# echo $SHELL


What is your current shell? And what is it called?

To find out the shells available on the system


1. The list of all the shells are usually stored in the “/etc/shells” file. Display the contents
of that file. Type:


[root@localhost root]# cat /etc/shells

/bin/sh
/bin/bash
/sbin/nologin
/bin/bash2
/bin/tcsh
/bin/csh
………



To temporarily switch your shell


1. You will change your shell to the C – shell. Type


[root@localhost root]# csh

[root@localhost ~]#



2. Your shell has changed. To show this type :


[root@localhost root]# echo $0


Write down the output?


3. Return to your parent shell. Type


[root@localhost ~]# exit


4. Type exit again. What happened?




Created by: system. Last Modification: Monday 24 of November, 2008 18:07:18 EST by wale.

...