The following command recursively searches a directory for a given pattern in  the file name and deletes all the files found.

 

 {code}

find . -name "*.log" -type f -exec rm -f {} \;

 {/code}

In the above example the pattern is *.log. So the command deletes all the files with the extension log.