Searching and deleting

Hi Guys
I hope this is an easy one, is it possible to write a unix bash script, (or just a command) to search for wildcards and then delete that wildcard once it is found, and the search is performed over a whole directory tree. eg it searches for *.ppp then once it finds them it deletes ???.ppp. Sorry I'm a not too clued up on unix yet so any help would be great

thanks heaps

Enter in the "root" of your directory tree and then:

find . -name "*.txt" -exec ls -l {} \;

Once you are sure that the displayed files are the ones you which to remove, change the "ls" command with "rm":

find . -name "*.txt" -exec rm {} \;

For more info try also "man find" and search for the "-exec" option.

Thankyou so very much, that was exactly what I wanted

Sorry last question

Is it possible to perform that above command but exclude a directory - say I did a search with in their home area but wanted to exclude the library directory how would I do that?

Thanks heaps