What shell am I in?

When you connect to a system, whether directly on the system’s keyboard or through a remote connection you will automatically start in your default shell. The default shell was originally assigned to you when your account was created.

To find out what shell you are currently using we can use the echo command:

$ echo $SHELL
/bin/bash

In this command we are using the echo command to examine the value of the environment variable $SHELL. This variable was set by the system when we started this command line session and shows the full path to the shell we were assigned at login. Here are some common shells you might see:

  • /bin/sh – Bourne shell
  • /bin/bash – Bourne Again shell
  • /bin/csh – C shell
  • /bin/ksh – Korn shell
  • /bin/tcsh – TC shell
  • /bin/zsh – Z shell

Shell binaries are also commonly found in the /usr/local/bin directory. Consult your system administrator if you’re having trouble finding your shell binaries.

Oracle Shell ScriptingFor more information like this check out my book Oracle Shell Scripting, only $34.95 from Rampant TechPress.

Buy it now!