On Mon, Oct 18, 2010 at 1:20 AM, Siddhesh Poyarekar
<siddhesh.poyare...@gmail.com> wrote:
> On Mon, Oct 18, 2010 at 1:14 AM, Zico <mailz...@gmail.com> wrote:
>> Hi, I need some idea regarding scripting. I need to run a script, which will
>> search for the (latest-1) file from a folder. Here, (Latest-1) means: this
>> script will find the file which is not the last edited/saved file but the
>> immediate previous edited/saved file of that lastest one? Is it possible?
>>
>
> ls -1rt | tail -2 | head -1
>

Or of course,

ls -1t | head -2 | tail -1

;)

-- 
Siddhesh Poyarekar
http://siddhesh.in
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to