I've been tuning my shell for 6 years. Most aliases I create, I never use again. But three have stuck — and they save me genuine time.
1. gp — Git Push With Branch Tracking
alias gp='git push -u origin $(git branch --show-current)'
I type gp instead of git push -u origin feature/my-branch-name dozens of times a day. The --show-current flag grabs the current branch name automatically.
Time saved: ~15 seconds × 20 pushes/day = 5 minutes/day
2. serve — Instant HTTP Server
alias serve='python3 -m http.server 8000'
Need to share a file? Preview HTML? Test CORS? Just cd into a directory and type serve. Python's built-in server is good enough for 90% of cases.
For more features:
alias serve='npx serve -l 8000' # Directory listing, CORS headers, SPA support
Time saved: ~30 seconds × 5 uses/day = 2.5 minutes/day
3. .. / ... / .... — Fast Directory Navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
Tiny, but I use these 50+ times per day. It adds up.
Bonus — mkcd: Create a directory and cd into it in one command:
mkcd() { mkdir -p "$1" && cd "$1"; }
Time saved: ~3 seconds × 50 uses = 2.5 minutes/day
Honorable Mentions
# Quick git status
alias gs='git status -sb'
# Pretty git log
alias gl='git log --oneline --graph --decorate -20'
# Find process on port
alias port='lsof -i -P -n | grep LISTEN | grep'
# Docker cleanup
alias dclean='docker system prune -af --volumes'
# Quick Python REPL with useful imports
alias py='python3 -c "import json, os, sys; from pathlib import Path; print("Ready")" && python3'
What Are Your Must-Have Aliases?
I'm always looking for new ones. What's the alias you'd be lost without?
I build developer tools and write about productivity. 130+ open source repos.
Top comments (0)