ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shackelford, John-Mason" <>
Subject RE: Delete all but the most recent N files
Date Wed, 09 Oct 2002 21:12:37 GMT

Great idea! Now I am using the following nasty shell line, but it would be a
great task.

ls -1 -t | tail -n $[`ls -1 | wc -l` -150] | perl -n -e 'print $_;chomp
$_;unlink("$_");' | cat -n

removes all but the most recent 150 files in the current directory

John-Mason Shackelford

Software Developer
NCS Pearson - Measurement Services
2510 North Dodge St.
Iowa City, IA 52245

This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message