Skip to content

Latest commit

 

History

History
67 lines (37 loc) · 1.97 KB

File metadata and controls

67 lines (37 loc) · 1.97 KB

Bash Tips

References

Files

  • .bash_profile

    • The personal initialization file, executed for login shells
    • runs once when you log in (login shell)
    • Settings defined in .bash_profile (like environment variables) are generally inherited by all subsequent shells and processes started within that login session.
    • Ensure that your ~/.bash_profile (or ~/.profile, if ~/.bash_profile doesn't exist) explicitly sources your ~/.bashrc using a command like if [ -f ~/.bashrc ]; then source ~/.bashrc; fi
  • .bashrc

    • The individual per-interactive-shell startup file
    • runs every time you open a new interactive shell (non-login shell)
    • Put most of your configuration (aliases, functions, prompt customization, and environment variables) in your ~/.bashrc file.
  • .bash_logout

    • The individual login shell cleanup file, executed when a login shell exits
  • .profile

    • has the stuff NOT specifically related to bash, such as environment variables (PATH and friends)
    • must be compatible with any /bin/sh – this includes bash, dash, ksh, whatever else a distro might choose to use. (?)

Community Resources

Commands