find all file extensions in a directory and delete code example
Example 1: rm files with extension
find . -name "*.bak" -type f -delete
Example 2: ubuntu delete all files with extension
cd <dir>
find . -type f -iname \*.jpg -delete
find . -name "*.bak" -type f -delete
cd <dir>
find . -type f -iname \*.jpg -delete