Removing pesky Icon* files using find and rm on the command line Aug 6 2004

So, I konw a few things, but this is a shell command that I’ve wanted to figure out for a long time. Basically, it searches through the current and all subdirectories looking for any files named Ico* (Icon, Icon?…) which sometimes I’ve found get uploaded when using Mac (I believe they’re the Icon resource pointers, but are in fact empty files…) Working on getting SVN all set up on the ‘book and wanted to get rid of those pesky Icon files. This command does the trick perfectly.

First, run

find . -name Ico*

to list out all the Icon files you actually have.

Then, run

find . -name Ico* -exec rm -f {} \;

to actually remove them. SWEET!

Thanks to Sams Teach Yourself Shell Programming in 24 Hours:!


Leave a Reply

sell diamonds