Re: find most recent file update in directory

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



On Fri, Dec 09, 2011 at 10:09:27AM -0500, Windsor Dave L. (AdP/TEF7.1) wrote:
> I like:
> 
> find . -type f -printf '%TY/%Tm/%Td %TH:%TM:%TS %p\n' | sort -n | tail -1
> 
> which shows the last access date/time in a human-readable format that also sorts nicely (YYYY/MM/DD HH:MM:SS).
> 
> Note that some distros include fractional values with the seconds
> (%TS), making it even more accurate.  My CentOS 5.7 server does not,
> my Kubuntu 11.10 desktop does.

I considered that as well, but as you point out it will not properly
order files due to lack of second resolution.  One can stick an "-ls" on
find to get human-readable timestamps on the returned file list if
necessary.




							John
-- 
Be in charge of your own destiny, or some one else will.

-- John Francis "Jack" Welch, Jr. (1935-), past Chairman
   and CEO of General Electric 

Attachment: pgpvW0vxMe9gN.pgp
Description: PGP signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux