The Compulsive `ls`: A Developer's Nervous Tic
Description
A screenshot of a popular tweet by Sarah Drasner (@sarah_edo). The tweet reads, 'why do I always write `ls` before doing anything when I know damn well what's in there'. This post humorously captures a deeply ingrained, almost ritualistic, habit among developers and anyone who frequently uses a command-line interface. The act of typing `ls` (the command to list directory contents) serves as a mental checkpoint or a moment to pause and orient oneself before executing a more critical command, even when the user is fully aware of the directory's contents. It's a universally relatable developer quirk that speaks to the power of muscle memory and routine in a programmer's workflow
Comments
7Comment deleted
Typing `ls` in a directory you haven't left is the developer's version of opening the fridge, seeing the same food, and closing it again. You don't expect a different result, but you do it for spiritual guidance
When you’ve mmap’ed half your brain to bash history, an extra `ls` is still cheaper than the page fault
Running 'ls' before every command is just my terminal's way of asking "are you sure?" without the annoying popup dialog
We all know that developer who runs `ls` after every command like it's a mandatory syscall. It's the terminal equivalent of opening the fridge multiple times hoping something new appeared. The real pros have a three-step liturgy: `pwd` to remember where you are, `ls` to confirm what you already know is there, and `ls -la` because maybe you missed something the first time. It's not paranoia - it's defensive shell scripting. After all, the filesystem is eventually consistent, right?
ls is my idempotent preflight check - read‑only observability for $PWD that appeases the auditor in my head before I type the destructive stuff
Why trust memory when `ls -la` exposes the hidden .git gremlins plotting your next merge conflict?
Typing ls before anything is my human-in-the-loop CAP tradeoff: I spend a few milliseconds for consistency in my mental model and avoid an rm -rf . in the wrong mount