Why is there no summary option in coreutils
ls
command, like MS-DOS/Windows has?
With summary option I mean:
count the *files* and *dirs* and sum up their *sizes*.
*Update:*
It should read: "*Even* DOS/Windows has one."
It's:
command.com vs. sh
cmd.exe vs. bash
with clear points for the latters.
But for some reason, and that is the question, Linux/Unix has *no summary* in the directory listing.
And instead of fixing that, statements go out that this is right and the right thing to do and "well done"... Only after that threads explodes with solutions to fix this vacancy by scripting!
It seams to me a good example of the [**X-Y Problem**](https://mywiki.wooledge.org/XyProblem) :
- User wants to do X.
- User doesn't know how to do X, but thinks they can fumble their way to a solution if they can just manage to do Y.
- User doesn't know how to do Y either.
- **User asks for help with Y.**
- Others try to help user with Y, but are confused because Y seems like a strange problem to want to solve.
- After much interaction and wasted time, it finally becomes clear that the user really wants help with X, and that Y was a dead end.
---
Imagine the following:
You sit in a restaurant, the waiter brings the bill. He has listed all the dishes, but no summary! You have to do it yourself - he has already "well done".
Or hasn't he?
---
*Closing remark*:
Of course know I - and love - the *UNIX toolkit*. But the basic functions should be provided by the tool itself. To add a few numbers - at the right place, and especially in such a heavily needed case - is no thing. And I see no reason not to do it.
---
*Conclusion*:
My understanding is now: It's **POSIX**!
The [POSIX](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html) standard has no mention of a summary. And that's it.
It's carved in stone.
People don't even think about **X**. They are *used* to dealing with **Y**.
Nevertheless, it is astonishing how completely the possibility that it could also be otherwise is lost from view.
Asked by bashianer
(151 rep)
Nov 28, 2022, 03:55 PM
Last activity: Dec 16, 2022, 03:38 PM
Last activity: Dec 16, 2022, 03:38 PM