[nycbug-talk] Deleting Lots of Files.

N.J. Thomas njt at ayvali.org
Wed Jun 21 10:56:53 EDT 2006

* Hans Kaspersetz <lamolist at cyberxdesigns.com> [2006-06-21 10:44:01 -0400]:
> I was wondering what the best way to delete lots of files is.
> I would like to delete all the files in the 114* series.  However, when 
> I pass rm -f ./114*, I get to many arguments as an error.  What I really 
> want to delete is all files from before June.

See find(1), xargs(1).

You can use the -name "114*" arg for find to get all the 114* files or
the "-mtime -16" to get the files before June (but also see the -newer

Then just use something like "xargs -n 50 echo rm" (run with echo first
to see what is to be deleted).

I strongly suggest you learn find and xargs thoroughly, they are very
useful tools.


N.J. Thomas
njt at ayvali.org
Etiamsi occiderit me, in ipso sperabo

More information about the talk mailing list