Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 5 down vote accepted

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

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

Your Answer

 
discard

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.