I have a bunch of files i need to delete, they all start with 2011XXXX. How would i delete them. So far i have this command:

ls | grep 2011 | xargs rm 

And it works, but is there a better way to do this ?

link|improve this question
feedback

1 Answer

up vote 3 down vote accepted

If the files are all in the current folder, how about just rm 2011*? :)

link|improve this answer
1  
… unless that — given that we are nearing the end of 2011 — causes ARG_MAX, or related limits, to be exceeded. ☺ – JdeBP Nov 11 '11 at 0:52
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.