Selecting a Login Shell
Your login shell is the shell that the system starts up for you when you log in. You should determine which shell is your login shell, and change it if it's not the one you want to use. The SHELL environment variable usually contains the pathname of your login shell. You can display its value by using the echo command:
% echo $SHELLThe response from echo should be a pathname such as /bin/sh, /bin/csh, or /bin/ksh. The last part of the path tells you which shell you're using. If the shell you want to use is already your login shell, you're all set.
If you decide to use a different login shell, you need to know where that shell is located. Use the which command to determine the shell's pathname:
% which tcsh
/bin/tcshIn this example, which indicates that tcsh is installed in /bin/tcsh. (The path might be different on your system.) Once you know the shell's pathname, run your system's "change shell" command (probably chsh or passwd –s). Suppose your current shell is csh but you want to use tcsh and know from using which that its pathname is /bin/tcsh. Make tcsh your login shell like this:
%chshRun the change-shell command Old shell: /bin/csh chsh displays your current shell New shell:/bin/tcshType in the pathname of the shell you want to use
Some versions of chsh display a list of shells from which you can choose. Others need to be invoked this way instead:
% chsh dubois /bin/tcshThe first argument is your username (the name you use to log in) and the second is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access