Index | Thread | Search

From:
Ingo Schwarze <schwarze@usta.de>
Subject:
Re: mtime format in ls -l
To:
Crystal Kolipe <kolipe.c@exoticsilicon.com>
Cc:
tech@openbsd.org
Date:
Wed, 21 Jan 2026 19:46:23 +0100

Download raw body.

Thread
Hello Crystal,

Crystal Kolipe wrote on Sun, Jan 18, 2026 at 05:22:43PM +0000:

> The common reason for preferring stat over ls is in getting timestamps in a
> format that can be reliably parsed in scripts.
[...]
> Using -T improves the situation somewhat:
[...]
> This is somewhat easier to parse with a script, but there is a caveat - the
> times printed by ls are relative to the current timezone.
[...]
> So basically script writers who are trying to parse timestamps read from ls
> because they are unaware of stat are who would potentially benefit from a
> mention in ls(1).
> 
> Admittedly that might be a small audience, but I can imagine that it might
> avoid some overly complicated or buggy scripts being written.

I agree your reasoning makes some sense.

Then again, even that specific audience would likely be better served
by switching from sh(1) to perl(1) - in that respect i agree with sthen@.
So, even for that small audience, i'm not convinced promoting stat(1)
is all that helpful.

And then that potential but dubious benefit has to be balanced against
the potential harm of sending a much larger number of people from
the manual page of a POSIX utility to a manual page of a non-standard
tool with very limited portability.

So i'm unconvinced your argument is strong enough to change the bottom line.

Yours,
  Ingo