Logon Sequence (continued)

You are placed in the default shell as defined by the passwd login account file when you first log in to the system.

By using the command sh (Bourne shell), csh (C shell), or bash (Bash shell), a shell within the current shell, a subshell, will be created. You can repeat this process to create more subshells. Type exit or press Control + d to move back to the previous shell.

Note: Control + d does not work on all distributions.

The following table shows how the initialization files are read. We will assume that the .bashrc,.profile,.cshrc, and the . login files are located in the user's $ HOME directory.

Shell Read during Login Read Opening Shell
Bourne /etc/profile and .bash_profile .bash_profile
Bash /etc/profile, .bash_profile,and .bashrc .bashrc
C /etc/.login, .cshrc, and .login .cshrc