On 2026-11-18 00:56, Nuno Silva wrote:
> On 2026-11-17, Keith Thompson wrote:
>> [...]
>>
>> Reading the GNU coreutils ls documentation, I don't see any mention
>> of how `ls -tr a b` orders its output when a and b have the same
>> timestamp. I speculate that if the timestamps are the same, it
>> falls back to locale-specific alphabetical sorting -- and since
>> the `-r` (`--reverse`) option was given, it sorts b before a.
>> Someone could examine the source code.
>
> If it doesn't fall back to that, it should, at least if I'm reading
> right. IEEE 1003.1-2008 says it should sort by "filename in the
> collating sequence":
>
> «−t Sort with the primary key being time modified (most recently
> modified first) and the secondary key being filename in the
> collating sequence. [...]»
>
> 2024 at opengroup.org has the same:
> <https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ls.html>
Thanks for digging that up! :-)
(Makes all further speculations unnecessary.)
Janis
> [...]