Crawlicious

tools for web business

finding and deleting files

| 0 comments

For the last 12 years, whenever I needed to find and delete files on the unix / linux filesystem, I did this.


find . -name "*.xyz" | xargs rm -f

Today my friend showed me a very nice shortcut, and I think that it deserves it’s own blog post.


find . -name "*.xyz" -delete

Amazing!  I had no idea that find knew how to delete files.  Boy that makes me wish that I had read the man page more thoroughly :-)   Can I get my extra keystrokes and reaching for the | back?

 

Eric

Leave a Reply