Why keep 200 bash aliases when you use five?
It’s the question your terminal’s begging for. You’ve scavenged dotfiles repos, bloated your .bashrc with ‘performance theater’—shortcuts for commands you run once a moon phase. Then reality hits: purge time. I did. Ruthlessly. What’s left? The essentials. Real friction-killers for daily grinds. No fluff.
Look, good aliases aren’t cute tricks. They’re surgical. They shave seconds off paths you pound daily. The originals? Mostly cruft. But these survived my cull, plus functions that fix genuine pains. Let’s dissect ‘em—acerbic style.
Those .. Shenanigans You Secretly Crave
..=’cd ..’
…=’cd ../..’
....=’cd ../../..’
Child’s play? Maybe. But when you’re burrowing through nested hell—src/components/ui/themes/dark-mode-toggle/—it’s gold. No thinking. Just tap. And the ‘-’ alias? cd -. Back to last dir. Pure muscle memory bliss.
I flirted with zoxide, autojump. Fancy cd wrappers. Problem: servers without ‘em. Cognitive whiplash every SSH. So cd stays vanilla. Use z explicitly. Keeps you honest.
Git Aliases: Short, Not Stupid
Git’s verbose. These trim without hiding:
gs=’git status’ ga=’git add’ gc=’git commit’ gp=’git push’ gl=’git log –oneline –graph -20’ gd=’git diff’
Tried gcm for git commit -m. Awkward args killed it. Sweet spot: shorten the verb, spell out the rest. gl? Chef’s kiss. That graph—branch spaghetti untangled:
- 4a2b8c3 (HEAD -> main) Fix login validation
- 9c1e4d2 Add user profile page | * 7f3a9b2 (feature/oauth) Implement OAuth flow |/
- 3d8c7a1 Update dependencies
No GUI bloat. Instant clarity.
Here’s my unique gripe-slash-insight: dotfiles culture apes 90s Unix wizards—endless aliases mimicking vi keybindings or sed one-liners nobody types anymore. Bold prediction? Minimalism wins. As AI eats boilerplate, your shell thrives on precision tools, not arcana collections. Corporate PR spins ‘productivity suites’? Nah. This is raw Unix philosophy—do one thing, exceedingly well.
hg: History’s Unsung Hero
This one’s my MVP:
hg=’history | grep’
Forgot docker flags from hours ago? hg docker. Boom—numbered hits. !42 executes. No scrolling hell.
Safety nets next. cp=’cp -i’, mv=’mv -i’, rm=’rm -i’. Prompts before overwrites. Annoying? Once. Then you nuke a critical file—lesson learned. Permanent.
ls gripes. Default? Useless mush. Fix:
ls=’ls –color=auto -F’
ll=’ls -la’
la=’ls -A’
-F slaps / * @ on types. Glanceable. And sorting? Migrations, logs, semvers—alpha fails (10 before 2). lsn=’ls -lv’. Natural order. Sanity.
Config tweaks deserve love:
bashconfig=’${EDITOR:-vim} ~/.bashrc’
zshconfig=’${EDITOR:-vim} ~/.zshrc’
reload=’source ~/.bashrc’
Portable. Your editor, or vim default. No fuss across rigs.
Processes, Ports, and Tar Nightmares
pg=’ps aux | grep -v grep | grep -i’
pg node. Node procs, grep-free. Clean.
port=’netstat -tuln | grep’
Zombie ports? Found.
Tar flags? Brain-melter. untar=’tar -xvf’. Common case solved.
But archiving? Function time—aliases choke on vars:
function tardir() { tar -czf “${1%/}.tar.gz” “$1” }
tardir myproject. Done. .tar.gz magic.
Process Substitution: Bash’s Dark Magic
Now, the deep cut. <( ) and >( ). Treat command output as files. No temps.
Compare dirs: diff <(ls dir1) <(ls dir2)
Comm uniques: comm -12 <(sort file1.txt) <(sort file2.txt)
Tee variant: cat file.txt | tee >(wc -l > linecount.txt) | grep “pattern”
While loop sans subshell: while read line; do echo “Processing: $line”; done < <(cat file.txt)
<(command) reads output as file arg. >(command) writes to it via pipe. Diff loves <(). Tee tricks with >(). Loops? Subshell-proof.
I use diff daily—output diffs sans files. >( ) rarer, but potent for logging splits.
But here’s the critic’s lash: too many chase this as ‘pro’ flex. It’s useful, sure—until you port to zsh/fish mismatches. Stick to basics first. Bloat kills portability.
Why Does Your .bashrc Still Suck?
Purged mine yearly. 200 to 20. Freedom. Yours? Probably dotfiles cargo cult. Those GitHub stars? Hype. Real devs curate.
Critique the spin: authors tout ‘ultimate kits’ like enterprise SaaS. But Unix sed: small tools chain. Aliases same—don’t overengineer.
Test ‘em. hg docker. gl. .. .... Feel the snap.
One caveat—interactive flags like -i slow bulk ops. Script around ‘em. Context matters.
And zsh migrants? These port easy. But zoxide? Commit or regret server whiplash.
Will Bash Aliases Survive AI Terminals?
AI shells loom—Claude in terminal? Maybe. But friction’s human. Aliases evolve: hg becomes ai-history-grep. Core? Timeless.
Historical parallel: 80s .profile wars. Same bloat cycle. Winners? Minimalists like rms—lean, mean.
Adopt. Purge. Thrive.
🧬 Related Insights
- Read more: AI Agents Turn Traitor: This Week’s Security Alarms That’ll Haunt Devs
- Read more: Big Tech’s AI Gold Rush: Billions Bet on Code Wizards, Safety Nets Strain
Frequently Asked Questions
What are the best bash aliases for git?
gs=’git status’, ga=’git add’, gl=’git log –oneline –graph -20’. Short, visual, no obscurity.
How to grep bash history quickly?
hg=’history | grep’. Then !n to rerun. Essential.
Should I alias rm to rm -i?
Yes—once you fat-finger an overwrite, you’ll thank it. Annoyance beats catastrophe.