Linux bash profile

Understanding the Login Shell Process

When you log in to the Linux system, the bash shell starts as a login shell. The login shell typically looks for five different startup files to process commands from:

1. /etc/profile
→The /etc/profile file is the main default startup file for the bash shell. Whenever you log in to the Linux system, bash executes the commands in the /etc/profile startup first.

2. $HOME/.bash_profile

3. $HOME/.bashrc
→The .bashrc file does two things. First, it checks for a common bashrc file in the /etc directory. Second, it provides a place for the user to enter personal command aliases

4. $HOME/.bash_login

5. $HOME/.profile


Source: 
Linux Command Line and Shell Scripting Bible, Third Edition. (Book)

Leave a comment