The following command recursively searches a directory for a given pattern in the file name and deletes all the files found.
find . -name "*.log" -type f -exec rm -f {} \;
In the above example the pattern is *.log. So the command deletes all the files with the extension log.