[Gllug] Most Recent File

Richard Jones rich at annexia.org
Tue Nov 22 15:24:01 UTC 2005


On Tue, Nov 22, 2005 at 09:04:30AM -0000, Wiehe, Simon wrote:
> I normally just use ls -ltr which gives a reverse sort by date, the bottom 
> of the list is the last file saved/touched.

This is for a single directory though, right?  I also tried ls -lRt
but that just sorts each individual directory - it doesn't give you
the newest or oldest file in an entire tree.

My best attempt was:

  ls -l --time-style='+%s' -R | sort -k6 | less

but although it's just about human readable, it's not a very elegant
solution, nor is it usable in scripts.

I wonder if there's a better way without the attendant hideousness of
find(1).

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list