find newest file

Caporegime
Joined
18 Oct 2002
Posts
29,493
Location
Back in East London
I've got a restore script for restoring the latest .tar.gz of some directories, but the script we're using parses output from
Code:
ls -1t
and takes the first line. Just wondered if there was a straight up command for finding newest file.

Ta. :)
 
Last edited:
We're already using:
Code:
ls -1t /path/ | head -1
which works better :) Was just wondering if there was a "hidden" ls option or something. :)
 
Back
Top Bottom