3 ms·
I'd argue there's a difference between plumbing commands and UI commands. ls is strictly a UI command, a sort of mini-language to quickly and efficiently explor
by Asooka 9y ago
I'd argue there's a difference between plumbing commands and UI commands. ls is strictly a UI command, a sort of mini-language to quickly and efficiently explore the file system. If ls didn't exist as a binary, we'd all have an ls bash function in our .bashrc that does the same thing with some perverse combination of for, globs, and stat. If you ever pipe the output of ls to anything (barring very simple cases), you're probably doing it wrong and should switch to find -exec stat instead.
- vidarh 9y agoTry to replace ls with something that acts subtly different (or just give one precedence in your path) for a few weeks and you'll see a surprising amount of stuff calls out to ls. I agree it's a bad idea (or if you do, at the very least make sure you're calling out to /bin/ls...), but it certainly happens.