4 ms·
It's not the pipeline that falls apart, it's the formatting of data that is applied too early in the process. Report the sizes numerically in the same unit, sor
by paedubucher 6y ago
It's not the pipeline that falls apart, it's the formatting of data that is applied too early in the process. Report the sizes numerically in the same unit, sort them numerically, and then format the numbers in a human readable fashion.
`sort -h` is only needed because `du -h` is used in the first place. I admit that `du -h` comes in handy often, it is better not used for further processing.
Your proposed approach is not only more Unix-like, but also does not require bloated implementations of `du` and `sort` capable of parsing human-readable size indications.
- michaelcampbell 6y ago> I admit that `du -h` comes in handy often, it is better not used for further processing. I'd posit that once you use -h or equivalent, any further processing by a NON-HUMAN that works the way you want is a lucky side effect.