- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] How to remove files en masse
- From: Sebastian Welsh <swelsh@xxxxxxxxxxxx>
- Date: Wed, 22 Sep 2004 09:39:47 +1000
On Wed, 2004-09-22 at 09:12 +1000, Simon Bryan wrote:
> Hi all,
> We have run out of space in our user directory file. All users have been
> warned to delete or convert the thousands of bmp files to soemthing else
> or they will be deleted. So now I want to carry out my threat. I can list
> them all with
>
> ls -alR |grep bmp
>
> but how do I feed something like that to 'rm'
More fun with find
find . -name "*.bmp" -exec rm {} \;
Alternatively
ls -alR | grep bmp | xargs rm
would do the trick but I'd advocate using a stronger regular expression
as otherwise
buysimonnewibmpc.doc in the accounts directory goes, too.
Cheers, Seb.