Shell Configuration File: ~/.bashrc

What’s Volatile?

  • Settings from the commandline aren’t usually persistent

  • Tuning the PATH environment variable is in effect only for the current shell/process and for all of its descendants

  • Nobody outside that shell’s process tree can see the modification (environment variables are inherited after all)

  • After a reboot, they are definitely gone

    $ PATH=/home/jfasch/bin:$PATH
    $ export PATH
    
  • Same with shell aliases

    $ alias d='ls -al'
    

Solution: ~/.bashrc

  • Write everything that needs to persist (and is re-initialized at every login) in ~/.bashrc

  • Read be every shell that starts up

“Sourcing” a file

  • If you do not want to quit your running shell, you can always re-read the file into the current shell, by “sourcing” it

    $ . ~/.bashrc
    

    or, equivalently,

    $ source ~/.bashrc