4 ms·
Not the same thing, ls -l | sort +date,-size was to show how sorting by date ascending and size descending could work. 'sort' can sort by different fields
by justinsaccount 10y ago
Not the same thing,
ls -l | sort +date,-size
was to show how sorting by date ascending and size descending could work. 'sort' can sort by different fields in different orders, but to sort times properly you'd need to use ls with `--full-time` or --time-style=long-iso` which is in GNU ls but not the BSD ls on OS X.
You'd end up with something like
ls -l --full-time |sort -k 6,5rn
But that doesn't quite work. Besides, the 'sort -k 6,5rn' instead of 'sort +date,-size' is exactly the kind of thing I was trying to show.
We could have had a sort that let you do '+date,-size', instead we have a 'universal interface'.