Why Aliases Are a Terminal Superpower
If you spend significant time in the terminal, aliases are one of the highest-ROI productivity improvements you can make. A well-curated ~/.bashrc (or ~/.zshrc for Zsh users) transforms tedious, repetitive commands into snappy two- or three-character shortcuts.
This article covers practical aliases organized by category. Add the ones that fit your workflow and make them your own.
How to Add Aliases
Open your shell config file and add alias definitions:
# Open with your editor
nano ~/.bashrc
# or
code ~/.bashrc
After saving, reload the file without restarting your terminal:
source ~/.bashrc
Navigation Aliases
# Go up directory levels quickly
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
# Jump to common directories
alias home='cd ~'
alias desk='cd ~/Desktop'
alias proj='cd ~/Projects'
# List files with useful defaults
alias ls='ls --color=auto'
alias ll='ls -lah' # long list, all files, human-readable sizes
alias la='ls -A' # all files except . and ..
alias lt='ls -lht' # sorted by modification time
Git Aliases
These are some of the most-used aliases in any developer's toolkit:
alias gs='git status'
alias ga='git add'
alias gaa='git add .'
alias gc='git commit -m'
alias gca='git commit --amend'
alias gp='git push'
alias gpl='git pull'
alias gco='git checkout'
alias gcb='git checkout -b'
alias gb='git branch'
alias gbd='git branch -d'
alias gl='git log --oneline --graph --decorate --all'
alias gd='git diff'
alias gds='git diff --staged'
alias gst='git stash'
alias gstp='git stash pop'
File & System Aliases
# Safety nets
alias rm='rm -i' # always confirm before deleting
alias cp='cp -i' # confirm before overwriting
alias mv='mv -i' # confirm before overwriting
# Disk usage
alias df='df -h' # human-readable disk space
alias du='du -sh *' # summarize sizes of current directory items
alias free='free -h' # human-readable memory usage
# Find files quickly
alias ff='find . -name' # usage: ff "*.py"
# Search file contents
alias grep='grep --color=auto'
alias rgrep='grep -r --color=auto'
Network Aliases
# Get your public IP
alias myip='curl -s ifconfig.me && echo'
# Ping with limited count
alias ping='ping -c 5'
# Check open ports
alias ports='ss -tulpn'
# Download a file with progress
alias wget='wget -c' # resume incomplete downloads
Development Workflow Aliases
# Python virtual environments
alias venv='python3 -m venv venv'
alias activate='source venv/bin/activate'
# Docker shortcuts
alias dps='docker ps'
alias dpsa='docker ps -a'
alias dimg='docker images'
alias dcu='docker-compose up -d'
alias dcd='docker-compose down'
alias dcl='docker-compose logs -f'
# npm / Node
alias ni='npm install'
alias ns='npm start'
alias nb='npm run build'
alias nt='npm test'
# Quick HTTP server in current directory
alias serve='python3 -m http.server 8080'
Productivity Aliases
# Reload shell config
alias reload='source ~/.bashrc'
# Edit shell config quickly
alias ebrc='${EDITOR:-nano} ~/.bashrc'
# Clear screen
alias c='clear'
# Command history search shortcut
alias h='history | grep' # usage: h docker
# Show PATH entries one per line
alias path='echo $PATH | tr ":" "\n"'
Pro Tips
- Use functions for complex logic. If an alias needs arguments beyond a simple append, turn it into a shell function instead.
- Keep a backup. Commit your dotfiles to a Git repo so you can restore your environment on any machine instantly.
- Review occasionally. Aliases you never use are just noise. Audit your list every few months.
- Zsh users: All of these work in
~/.zshrctoo. Consider Oh My Zsh for a plugin ecosystem that includes many of these aliases out of the box.
Final Thoughts
The terminal is your most direct interface with your system — it deserves the same thoughtful customization as your editor or IDE. Start with the aliases that match your daily workflow, build the habit of using them, and add more as you identify friction points. Your future self will thank you every day.