Need help deleting files one week older

Hi,
I need to delete *.bad files which are 1 week old. How can I achieve that. I tried doing through below script but it deletes all the files.

find ./ -mtime +7 -exec rm *.bad {} \; 

The below one works but i want to delete only files with .bad extension

find . -mtime +7 | xargs rm

You forgot to | grep ".bad" before your xargs...

Try first to list them:

find ./ -type f -name "*.bad" -mtime +7 -print

If this is what you want, delete them:

find ./ -type f -name "*.bad" -mtime +7 -exec rm {} \;