Bash aliases I use every day
A short list of bash aliases I've kept across multiple machines for years. Nothing fancy — just things I type often enough that the abbreviation saves real time.
# Navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ll='ls -lah'
# Git
alias gs='git status'
alias ga='git add'
alias gc='git commit -m'
alias gd='git diff'
alias gl='git log --oneline --graph --decorate -20'
alias gco='git checkout'
# Activate Python venv
alias va='source .venv/bin/activate'
# Show local IP
alias myip='ipconfig getifaddr en0'
# Quick HTTP server in current dir
alias serve='python3 -m http.server 8000'
# Safer rm
alias rm='rm -i'
# Open current dir in editor
alias e='code .'
The git ones save me probably 30+ keystrokes a day.
gl in particular — I run it constantly to remember what
I was doing yesterday.
A couple I tried and removed
alias cl='clear' — too short, kept hitting it accidentally
when I meant cd.
alias gp='git push' — caused too many oopsies. I'd rather
type the full word and think about it.
Where to put them
~/.bashrc on most Linux systems. ~/.zshrc on
macOS Catalina and later. After saving, either restart your shell or
run source ~/.zshrc.
The rule I follow: only alias commands you run more than 10 times a day. Otherwise the cost of remembering the alias outweighs the typing saved — and you'll be that person who can't use anyone else's terminal.