Recursively Find and Delete All Files of a Specific Extension in the Current Directory

Use find.

To see exactly which files you will remove:

find . -name "*.bak" -type f

To count the number of files:

find . -name "*.bak" -type f | wc -l

To delete these files:

find . -name "*.bak" -type f -delete

Make sure that -delete is the last argument in your command. If you put it before the -name "*.bak" argument, it will delete everything.