Index | Thread | Search

From:
Crystal Kolipe <kolipe.c@exoticsilicon.com>
Subject:
Re: mtime format in ls -l
To:
Ingo Schwarze <schwarze@usta.de>, tech@openbsd.org, Jan Stary <hans@stare.cz>
Date:
Fri, 16 Jan 2026 21:55:02 +0000

Download raw body.

Thread
On Fri, Jan 16, 2026 at 08:45:18PM +0000, Stuart Henderson wrote:
> On 2026/01/16 20:04, Crystal Kolipe wrote:
> > Any half sensible script that was parsing dates from ls(1) would surely be
> > using -T together with -l, (or -g, or -n), anyway, so the 'mmm dd HH:MM' would
> > not even apply in that case.
> > 
> > I wonder if the 'see also' section should include a reference to stat(1),
> > since ls(1) doesn't provide an option equivalent to -P in df(1), for obvious
> > consumption by scripts.
> 
> I don't think there's any good portable tool to do this from the shell.
> GNU ls doesn't do -T and we don't have the overengineered --time-style,
> and stat(1) is probably the least portable of all the standard unix
> utilities I've come across. Seems like a job for perl.

We've had a similar version of this discussion before about the
non-portability of stat(1).

But at the end of the day, people writing scripts on OpenBSD are not
necessarily interested in portability, so that doesn't seem like a reason to
exclude simple solutions that work without difficulty on OpenBSD in favour of
something more complicated that hopefully works 'everywhere'.