Killing “find” Errors
I’ve used the unix filesystem search utility find for many years. Though, like most things, until forced to learn its deeper secrets, I generally get by with only the most basic knowledge.
One of the cool things about find is that you can specify a search and then execute an action on the results, all in one command.
This example is probably my most common use of find:
find . -type d -name .svn -exec rm -fr {} \;
This means: find, in the current directory (.), a directory (-type d), named .svn (-name .svn), and for every result (-exec) remove that directory (rm -fr {}) . The “{}” represents the matched path string, and the “;” is required to end the “-exec” command.