Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By default, none of the following files may be present on your account, and you will get the default settings for the system. However, you may want to customise your environment to add new variables, functions or aliases to your sessions or jobs.

FileWhen is it is sourced?Who sources it?What is it for?
$HOME/.profile
each login and job executionBash and kshSuitable for your own login session settings (e.g. PATH).
$HOME/.bash_profile
each bash login and job executionBash only

Suitable for your own login session settings that must only run once for the session or job (e.g. PATH).

It overrides .profile if present

$HOME/.bashrc
each bash interactive non-login shellBash only

Suitable for your own functions and aliases to load for interactive non-login sessions.

It is not loaded automatically on login sessions

$HOME/.bash_logout
each bash exit and end of jobBash onlySuitable for your own cleanup settings at the end of the session or job
$HOME/.kshrc
each ksh login and job executionksh onlySuitable for your own settings to load for interactive shells

...