bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find -ls flexible date not also available via % escapes


From: Stepan Kasal
Subject: Re: find -ls flexible date not also available via % escapes
Date: Tue, 4 Jun 2002 12:37:58 +0000 (UTC)
User-agent: slrn/0.9.6.2 (Linux)

Hallo,

On 04 Jun 2002 01:46:30 +0800, Dan Jacobson <address@hidden> wrote:
> Find's time formats don't give a flexible date choice, like that used
> in ls -l or find . -ls, where if a file is more that 6 months old the
> hours:minutes is replaced by the year .

You can emulate this behaviour, eg.:

find . -mtime +180 -printf "%Tb %Te  %TY %f\n" -o -printf "%Tb %Te %TH:%TM %f\n"

> It's in there, under find . -ls, but has not been made available via %
> escapes. 

Sure it is, but the problem is that %A* %C* and %T* format letters
have the same meaning as in strftime(3) format.
In fact, find calls strftime to do the time output.

So, both for consistency and for easy implementation, you have to allocate
a letter for this traditional date/time display, get it to POSIX, GNU libc
or another influential spot.

Then, like a magic, your old copy of find will support the new format.
Just use -printf "%Tq" (if `q' is the letter).

HTH,
        Stepan Kasal





reply via email to

[Prev in Thread] Current Thread [Next in Thread]