Skip to content

Home Files

Managing Mac/Linux home files

homefiles command

See homefiles_setup

Ignore all files by default:

homefiles config --local status.showUntrackedFiles no

Shell Startup Files

Bash

Bash startup files showing the order (A, B, etc.) which files are sourced depending on how the shell was run.

File Interactive
Login
Interactive
non-login
Script
STARTUP FILES
/etc/profile A -- --
/etc/bashrc -- A --
~/.bashrc -- B --
~/.bash_profile B1 -- --
~/.bash_login B2 -- --
~/.profile B3 -- --
BASH_ENV -- -- A
SHUTDOWN FILES
~/.bash_logout C -- --

List all possible Bash dotfiles:

ll /etc/profile /etc/bashrc ~/.bashrc ~/.bash_profile ~/.bash_login ~/.profile ~/.bash_logout

On my system:

  • /etc/profile sources /etc/bashrc if not running bash
  • /etc/bashrc sources /etc/bashrc_$TERM_PROGRAM — there isn’t one for iTerm.app
  • ~/.bashrc sources /etc/bashrc
  • ~/.bash_profile sources ~/.bashrc

Z Shell

Z Shell startup files showing the order (A, B, etc.) which files are sourced depending on how the shell was run.

File Always
Sourced
Login
Shell
Interactive
Shell
STARTUP FILES
/etc/zshenv X
~/.zshenv X
/etc/zprofile X
~/.zprofile X
/etc/zshrc X
~/.zshrc X
/etc/zlogin X
~/.zlogin X
SHUTDOWN FILES
~/.zlogout I -- --
/etc/zlogout J -- --

List all possible Z Shell dotfiles:

ll /etc/zshenv ~/.zshenv /etc/zprofile ~/.zprofile /etc/zshrc ~/.zshrc /etc/zlogin ~/.zlogin ~/.zlogout /etc/zlogout

On my system:

  • /etc/zshrc sources /etc/zshrc_$TERM_PROGRAM — there isn’t one for iTerm.app
  • ~/.zshrc sources $ZSH/oh-my-zsh.sh