Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question
up vote 5 down vote accepted

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

share|improve this answer
… 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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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