<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:12pt">-printf is a Linux exclusive. Well I guess this is TCLUG.<br><div> </div><span style="font-family: courier;">--- </span><br style="font-family: courier;"><span style="font-family: courier;">Wayne Johnson, | <span style="color: rgb(191, 95, 0);">There are two kinds of people: Those</span> </span><br style="font-family: courier;"><span style="font-family: courier;">3943 Penn Ave. N. | <span style="color: rgb(191, 95, 0);">who say to God, "Thy will be done," </span></span><br style="font-family: courier;"><span style="font-family: courier;">Minneapolis, MN 55412-1908 | <span style="color: rgb(191, 95, 0);">and those to whom God says, "All right, </span></span><br
style="font-family: courier;"><span style="font-family: courier;">(612) 522-7003 | <span style="color: rgb(191, 95, 0);">then, have it your way." --C.S. Lewis</span><br></span><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Dave Sherohman <dave@sherohman.org><br>To: tclug-list@mn-linux.org<br>Sent: Wednesday, January 9, 2008 5:30:21 PM<br>Subject: Re: [tclug-list] Finding the date of the newest file in a directory tree<br><br>
On Wed, Jan 09, 2008 at 05:20:14PM -0600, Florin Iucha wrote:<br>> On Wed, Jan 09, 2008 at 04:57:04PM -0600, Dave Sherohman wrote:<br>> > Not entirely "quick" when dealing with a million files, but<br>> > <br>> > find /some/dir/ -exec ls -l {} \; | awk '{print $6,$7,$8}' | sort
-r | head -1<br>> <br>> Ewwwww... ETOOMANYLS<br>> <br>> find /some/dir -type f -printf "%h/%f %A@\n" | sort -rn -k2 | head -1<br><br>*bows* Yours is the superior find-fu. I wasn't even aware it had a<br>-printf option.<br><br>But wouldn't you want %T@ (mtime) rather than %A@ (atime), since we're<br>looking for the most recently modified file?<br><br>-- <br>I reckon we are now the only monastry ever that had a dungeon stuffed
with<br>sixteen thousand zombies.<br> - <a target="_blank" href="http://perlmonks.org">perlmonks.org</a><br><br>_______________________________________________<br>TCLUG Mailing List - Minneapolis/St. Paul, Minnesota<br><a ymailto="mailto:tclug-list@mn-linux.org" href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a><br><a href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list" target="_blank">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a><br></div><br></div></div><br>
<hr size=1>Never miss a thing. <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>
</body></html>