The difference between .bashrc, .bash_profile, .profile etc.
/etc/profile
System-wide initialisation file, executed when an login shell starts.
~/.bash_profile
Personal initialisation file, executed when an login shell starts.
~/.bashrc
Personal startup file, executed when an interactive shell starts and is not a login shell.
~/.bash_logout
Personal cleanup file, executed when a login shell exits.
~/.profile
Quoting from the file itself:
Executed by the command interpreter for login shells.
This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login exists.
For different shells, the bash-specific filenames are modified accordingly, e.g. ~/ash_profile
in ash shell
To avoid duplicate commands and get around shell-specific differences, users often call one file from another, especially in the case of .bashrc
and .bash_profile
.
Links
Anything to add? Let's talk @kgoutsos.
Share this page on
Twitter,
Facebook,
LinkedIn or use the permalink.