When you log in, the system first asks for your user name (to identify your home directory and permissions), then your password (to confirm your identity). Having identified your account, the system then starts a shell for you.
If you are using the Bourne shell (sh) or the Korn shell (ksh), the shell first executes the commands stored in the generic environment file /etc/profile, then the commands stored in the personalized environment file called .profile located in your home directory, if that file exists. A Korn shell additionally looks for a file called .kshrc; if it exists, this is executed after .profile.
If you are using the C shell (csh), the shell executes the commands stored in the file /etc/cshrc, then any commands present in a file called .cshrc in your home directory, if that file exists. The shell then looks for a file called .login; if it exists, any commands in it are executed. Note that the default prompt for the Korn and Bourne shells is the ``$''; the C shell's default prompt is the ``%''.
You can find annotated examples of .profile, .kshrc, .login, and .cshrc files in ``Sample shell startup files''.
These files set up your work environment. They contain commands to configure your terminal type and to set up various environment variables (see ``Understanding variables'' for details). The login files also contain any other commands that you want to have executed every time you log in.
The login procedure displays a lot of information that you may not need or want. If you specifically do not want to see system messages (such as your last login date, the message of the day, or the system copyright message), create an empty file in your home directory called .hushlogin. For example:
$If you execute this command, you must use the -a option to ls in order to list the newly created file: ls on its own does not list ``dot'' files. The touch command updates the last access time of a file; if you give it a filename which does not exist, it creates an empty file of that name.
Note that the ability to use .hushlogin may be disabled if your system is running at an enhanced security level. If this is the case, you will see the login messages whether there is a .hushlogin file in your home directory or not.