ant-user mailing list archives

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

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
319-354-9200x6214
shacjo@ncs.com


**************************************************************************** 
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:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message