Modern, modular Bash configuration mirroring the Zsh setup for consistency across shells
~/.bash_profile # Login shell entry point (sources .bashrc)
~/.bashrc # Main configuration entry point
~/.bash/ # Modular configuration directory
βββ 00-env.bash # Environment & theme configurations
βββ 01-path.bash # PATH management with lazy loading
βββ 10-aliases.bash # Command aliases & shortcuts
βββ 20-functions.bash # Custom shell functions
βββ 99-integrations.bash # External tool integrations
Note for macOS users: On macOS, terminals start login shells which read
.bash_profile, not.bashrc. The.bash_profilesimply sources.bashrcto unify behavior across platforms.
While Zsh is the primary shell, Bash configuration is maintained for:
- π₯οΈ Minimal servers - When only Bash is available
- π³ Containers - Docker/Kubernetes debugging
- π§ Recovery mode - System troubleshooting
- π Universal compatibility - Works everywhere
Platform-specific theming with automatic detection:
| Platform | Theme | Colors |
|---|---|---|
| π macOS | Catppuccin Mocha | Purple/Pink |
| π§ Linux | Snazzy | Cyan/Yellow |
| π Raspberry Pi | Snazzy | Cyan/Yellow |
Same modern tool aliases as Zsh:
| Traditional | Modern | Alias |
|---|---|---|
ls |
eza | ls, ll, l, lt |
cat |
bat | cat |
cd |
zoxide | z |
vim |
neovim | vim |
curl |
xh | http |
Purpose: Login shell entry point (macOS terminal sessions)
Features:
- Sources
~/.bashrcfor all configuration - Required on macOS where terminals start login shells
# Source .bashrc for interactive shell configuration
if [[ -f "${HOME}/.bashrc" ]]; then
source "${HOME}/.bashrc"
fiPurpose: Main configuration entry point
Features:
- Interactive shell detection
- Shell options (histappend, autocd, globstar, etc.)
- Modular config loading from
~/.bash/ - Starship prompt initialization
Shell Options:
shopt -s histappend # Append to history
shopt -s checkwinsize # Update terminal size
shopt -s cdspell # Correct cd typos
shopt -s autocd # cd without typing cd
shopt -s globstar # ** recursive glob
shopt -s nocaseglob # Case-insensitive globPurpose: Core environment variables, platform detection, and cache helper
Caches shell-init command output for 24 hours with automatic invalidation:
_cache_eval "name" "command" # Caches 'command' output to ~/.cache/shell/name.bashFeatures:
- Invalidates cache when binary path changes (e.g., Homebrew β Pacman, install β uninstall)
- Tracks binary path in
.metafile - Falls back to live eval if cache is stale or missing
- Used for: Starship, Zoxide, Atuin, Carapace initialization
Sections:
IS_MACOS=true/false
IS_LINUX=true/false
IS_RPI=true/false
IS_UBUNTU=true/false
IS_FEDORA=true/false
IS_ARCH=true/false
PLATFORM=macos/linux/rpi/ubuntu/debian/fedora/arch/omarchy/toolbox
MACHINE_PROFILE=mac-personal/mac-pro/ubuntu-desktop/ubuntu-server/rpi/arch-desktop/arch-server/omarchy/fedora-desktop/fedora-server/fedora-atomic/debian/toolboxmacOS: β
bbh-network: π
omv-*: π
Other Linux: πLANG=en_US.UTF-8
LC_ALL=en_US.UTF-8HISTFILE=~/.bash_history
HISTSIZE=50000
HISTFILESIZE=50000
HISTCONTROL=ignoreboth:erasedups
HISTIGNORE="ls:cd:exit:clear:history"macOS (Catppuccin Mocha):
STARSHIP_CONFIG=~/.config/starship/starship-desktop.toml
FZF_DEFAULT_OPTS="--color=bg+:#313244,bg:#1e1e2e..."
BAT_THEME="Catppuccin Mocha"
LS_COLORS=$(vivid generate catppuccin-mocha)Linux/RPi (Snazzy):
STARSHIP_CONFIG=~/.config/starship/starship-ssh.toml
FZF_DEFAULT_OPTS="--color=bg+:#3a3d4d,bg:#282a36..."
BAT_THEME="ansi"
LS_COLORS=$(vivid generate snazzy)Purpose: PATH management with performance optimization
Helper Functions:
path_prepend "/path" # Add to beginning if exists
path_append "/path" # Add to end if existsPATH Priority (highest first):
~/.local/bin~/.cargo/bin~/.antigravity/antigravity/bin(macOS)~/.jenv/bin(macOS)~/.rbenv/shims(macOS)~/.tmuxifier/bin(macOS)- System paths
/opt/X11/bin,/Library/TeX/texbin(macOS)~/.lmstudio/bin
β‘ Lazy Loading (macOS):
# pyenv loads only when first called
pyenv() {
unset -f pyenv
eval "$(command pyenv init -)"
pyenv "$@"
}
# jenv loads only when first called
jenv() {
unset -f jenv
eval "$(command jenv init -)"
jenv "$@"
}Purpose: Command shortcuts (identical to Zsh)
bashconfig # Edit ~/.bashrc with nvimvim='nvim'
cat='bat'
http='xh'
la='tree'ls='eza --color=always --icons'
ll='eza -l --color=always --icons --git -a'
l='eza -l --icons --git -a'
lt='eza --tree --level=2 --long --icons --git'
ltree='eza --tree --level=2 --icons --git'
zl='eza -lagX --icons --color=always'.. # cd ..
... # cd ../..
.... # cd ../../..
..... # cd ../../../..
...... # cd ../../../../..
iclouddrive # cd to iCloud Drivegc='git commit -m'
gca='git commit -a -m'
gp='git push origin HEAD'
gpu='git pull origin'
gst='git status'
glog='git log --graph --pretty=...'
gdiff='git diff'
gco='git checkout'
gb='git branch'
gba='git branch -a'
gadd='git add'
ga='git add -p'
gcoall='git checkout -- .'
gr='git remote'
gre='git reset'dco='docker compose'
dps='docker ps'
dpa='docker ps -a'
dl='docker ps -l -q'
dx='docker exec -it'k='kubectl'
ka='kubectl apply -f'
kg='kubectl get'
kd='kubectl describe'
kdel='kubectl delete'
kl='kubectl logs -f'
kgpo='kubectl get pod'
kgd='kubectl get deployments'
kc='kubectx'
kns='kubens'
ke='kubectl exec -it'
kcns='kubectl config set-context --current --namespace'gobust='gobuster dir --wordlist ~/security/wordlists/diccnoext.txt --wildcard --url'
dirsearch='python dirsearch.py -w db/dicc.txt -b -u'
massdns='~/hacking/tools/massdns/bin/massdns -r ...'
server='python -m http.server 4445'
tunnel='ngrok http 4445'
fuzz='ffuf -w ~/hacking/SecLists/content_discovery_all.txt -mc all -u'
nm='nmap -sC -sV -oN nmap'sshpw='ssh -o PreferredAuthentications=password'Purpose: Custom shell functions
cx /path/to/dir # cd + automatic eza listingfcd # Interactive FZF directory picker, then cdf # Select file with FZF, copy path to clipboardfv # Select file with FZF, open in neovimssh user@host # Automatically renames tmux window to hostname
# Restores window name after disconnectupdate-ai # Updates Claude Code, Copilot CLI, and Codex CLIsysup # Updates OS packages (apt/dnf/pacman), Flatpak, Homebrew, and AI toolsPurpose: External tool integrations
# Loads from ~/.fzf.bash or system location
# Provides Ctrl+R history, Ctrl+T file finder# macOS: Homebrew bash-completion
# Linux: /etc/bash_completion or /usr/share/bash-completion/source <(kubectl completion bash)
complete -o default -F __start_kubectl k # Alias completionsource <(helm completion bash)# Loads from /usr/share/bash-completion/completions/dockereval "$(zoxide init bash)" # Enables 'z' commandeval "$(atuin init bash)" # Magical shell historyeval "$(direnv hook bash)" # Auto-load .envrc filessource ~/.orbstack/shell/init.bashsource /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sheval "$(thefuck --alias)" # Enables 'fuck' commandcomplete -C aws_completer aws# Loads from system or Homebrew locationcomplete -C terraform terraform| Feature | Zsh | Bash |
|---|---|---|
| Framework | Oh-My-Zsh | None (manual) |
| Plugins | 8 OMZ plugins | bash-completion |
| Autosuggestions | zsh-autosuggestions | N/A (use atuin) |
| Syntax highlighting | zsh-syntax-highlighting | N/A |
| Prompt | Starship | Starship β |
| PATH uniqueness | typeset -U path |
Helper functions |
| Function removal | unfunction |
unset -f |
| Completion | compinit | bash-completion |
- Lazy Loading - pyenv/jenv load on first use
- Conditional Sources - Only load if tool exists
- No Heavy Framework - Pure bash, no bloat
# Time bash startup
time bash -i -c exit
# Detailed profiling
bash -x ~/.bashrc 2>&1 | head -50z project # Jump to frequently used directory
fcd # Fuzzy find and cd to directory
.. # Go up one levells # List with icons (eza)
ll # Long listing with git status
lt # Tree view
cat file.txt # Syntax highlighted (bat)
fv # Fuzzy find and editgst # git status
ga # git add -p (interactive)
gc "message" # git commit -m
gp # git push origin HEAD
glog # Beautiful git logdco up # docker compose up
k get pods # kubectl get pods
kl pod-name # kubectl logs -fEdit ~/.bash/10-aliases.bash:
alias myalias='command'Edit ~/.bash/20-functions.bash:
myfunction() {
# Your code
}Edit ~/.bash/00-env.bash:
export MY_VAR="value"Edit ~/.bash/99-integrations.bash:
if command -v newtool >/dev/null 2>&1; then
eval "$(newtool init bash)"
fi# Profile startup
time bash -i -c exit
# Check what's loading
bash -x ~/.bashrc 2>&1 | head -100# Check bash-completion is loaded
type _init_completion
# Reinstall on macOS
brew reinstall bash-completion@2# Check LS_COLORS
echo $LS_COLORS
# Check vivid
vivid generate catppuccin-mocha# Check PATH
echo $PATH | tr ':' '\n'
# Check if tool exists
which toolname
command -v toolname# Core (install via Homebrew or apt)
brew install eza bat fd ripgrep vivid fzf zoxide atuin direnv neovim starship
# Optional
brew install xh thefuckLast updated: 2026-03-28 Maintained by: Jerome Soyer (@jsoyer)