Skip to main content
  1. Today I Learned (TIL)/

Why I don't alias common commands

·202 words·1 min·

I was cleaning up my .zshrc tonight and found a commented-out alias cat='bat' I’d set months ago and quietly switched off. Seeing it reminded me why I keep almost no aliases for common commands.

bat is great: syntax highlighting, line numbers, a git gutter. But the moment I aliased cat to it, I started reaching for cat everywhere and forgetting what plain cat actually does. Then I’d SSH into a box that’s never heard of bat, type cat out of habit, and get output I didn’t expect. The alias didn’t save me keystrokes so much as it quietly eroded the muscle memory I rely on when I’m on someone else’s machine.

So my rule now: don’t alias the fundamentals. If I want bat, I type bat. The portability of knowing the real command beats the handful of characters an alias saves.

The exceptions are the long, machine-specific incantations I’d never memorize anyway. dexec for docker exec -ti earns its place; nobody’s muscle memory is better off typing that out forty times a day. The test I use: would forgetting the underlying command hurt me on a fresh machine? If yes, no alias. If it’s just verbose flag-soup I’d copy-paste regardless, alias away.

Chandler Thompson
Author
Chandler Thompson
I lead engineering teams and coach the people who run them. This is where I write down what actually worked.

Related