[CentOS] find most recent file update in directory
John R. Dennison
jrd at gerdesas.com
Fri Dec 9 14:27:57 UTC 2011
On Fri, Dec 09, 2011 at 03:15:53PM +0100, Mogens Kjaer wrote:
>
> Try something like:
>
> find . -type f -printf '%A@ %p\n' | sort -n | tail -1
I believe you want %T@ instead of %A@ (modification time versus access
time). I would also suggest sort -nr to sort from most recent to least
recent.
John
--
Anybody can win unless there happens to be a second entry.
-- George Ade (1866 - 1944), American writer, newspaper columnist,
and playwright
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20111209/f83be0f2/attachment.sig>
More information about the CentOS
mailing list