4 ms·
While I do appreciate the point that ls is doing sorting that sort would struggle to manage, isn't this an argument for better functionality in sort? Someone p
by betawolf33 14y ago
While I do appreciate the point that ls is doing sorting that sort would struggle to manage, isn't this an argument for better functionality in sort?
Someone pointed out that ls is really doing three things - listing files, sorting them and displaying them. That seems fairly accurate, and indeed it's convenient that it does.
But it's not 'doing one thing'. I'm not saying that's necessarily bad (as I just said, it's convenient), but it's not hardline Unix-way purity.
For practical reasons like those you raise, it makes sense for ls to handle its own sorting rather than leave it to the sort command, just as it handles its own formatting rather than let the user manage it. But those features _are_ something other than just reporting file listings, whatever the motivation for the feature creep. This convenient flexibility makes ls less single-task, less Unix-adherent but more generally useful on its own.