previous contents up next

Unix for Advanced Users

2. Logging In

2.5 The dotfiles

When you log in successfully, the first program started is the shell, or command line interpreter. This program gives you a method of communicating with the operating system to run and manage other programs. There are many shells, each offering different ways of entering and combining commands. The shell you are running now was most likely determined by your /etc/passwd entry.

At login time, each shell reads one or more initialization files from your home directory. These files give you the opportunity to set environment variables (such as PATH), command aliases, etc. If you are using sh, it will read the file called .profile; if you are using bash, it will read .bash_profile if it is present and .profile otherwise, followed by .bashrc. The csh reads .login first if it's a login shell, then .cshrc. Because these files' names start with dots, they are commonly called "dotfiles". Files that begin this way cannot be seen in a normal file listing; to see them, you must use the -a option to ls.

previous contents up next