Home Files¶
Managing Mac/Linux home files
homefiles command¶
See homefiles_setup
Ignore all files by default:
homefiles config --local status.showUntrackedFiles no
Links¶
- Dotfiles: Best Way to Store in a Bare Git Repository
- The best way to store your dotfiles: A bare Git repository
- A Simple Approach to storing Home Directory Config Files (Dotfiles) in Git using Bash, Zsh, or Powershell, without a Bare Repo
- The Bare Repo Approach to Storing Home Directory Config Files (Dotfiles) in Git using Bash, Zsh, or Powershell
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/profilesources- /etc/bashrcif not running bash
- /etc/bashrcsources- /etc/bashrc_$TERM_PROGRAM— there isn’t one for iTerm.app
- ~/.bashrcsources- /etc/bashrc
- ~/.bash_profilesources- ~/.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/zshrcsources- /etc/zshrc_$TERM_PROGRAM— there isn’t one for iTerm.app
- ~/.zshrcsources- $ZSH/oh-my-zsh.sh