Skip to content

Instantly share code, notes, and snippets.

@xaratustrah
Last active August 27, 2018 12:00
Show Gist options
  • Select an option

  • Save xaratustrah/d6461cdd893f3d07b7d7ceabd0b98ed8 to your computer and use it in GitHub Desktop.

Select an option

Save xaratustrah/d6461cdd893f3d07b7d7ceabd0b98ed8 to your computer and use it in GitHub Desktop.
bash_profile.md

BASH login vs non-login shell

login-shell

like in remote SSH reads ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order.

non login shell

like in Terminal in GUI reads /etc/bash.bashrc and ~/.bashrc

.profile

contains general things like the environment variables

.bashrc

contains the command prmpt coloring etc...

.bash_profile

makes sure that the above are also loaded for the login shells.

#
# .bash_profile
#

if [ -f ~/.bashrc ]; then
    source ~/.bashrc
fi

if [ -f ~/.profile ]; then
    source ~/.profile
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment