Skip to content

Latest commit

 

History

History

dotfiles

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Load profile under terminal

Ref: .bash_profile vs .bashrc

  1. .bash_profile, .profile are used for interactive login mode
    • .profile is not limited to bash
    • bash will search .bash_profile, then .profile
  2. .bashrc is used for interactive non-login mode
    • non-login: e.g., after login, we open new terminal window
  3. In MacOS, terminal is usually in interactive login mode
  4. How to load the dotprofile.template without repeat: We can put them into our .bash_profile or .bashrc
    if [ -f $DOTPROFILE ]
    then
        source $DOTPROFILE
    fi
        
  5. If planning to keep .bash_profile and .bashrc with the same enviroments, we can let write the codes above in .bash_profile, and source .bash_profile in .bashrc or vice versa.