Monday, May 28, 2007

Using the shell

The shell is the window where you type in commands. The unix shell is conceptually synonymous with the Windows 'command-line' although the commands are different. Most flavours of unix use bash, so this reference is intended to be bash-specific.

To find out what shell you are using type the following:

>echo $0

You could also type in:

>echo $SHELL

But this would only give you the default shell. If for some reason you had changed shell since logging in, echo $SHELL would not give you the current shell.

The terminal will now display a path which ends in either /sh, /csh, /tcsh, /ksh or /bash.

You can change shell by typing in 'sh', 'csh', 'tcsh', 'ksh' or 'bash'. Note that you are not strictly speaking changing shells but spawning new shells on top of the existing ones. To get back to the previous shell, use the 'exit' shortcut (ctrl-d) or type exit.

For the purposes of this manual echo $0 should return a path which ends in /bash, meaning that you are working in a bash shell. If for some reason you are not, type in bash which will invoke the bash shell.

Now we need to look at some commands!

No comments:

Post a Comment