how to remove certain file types from a directory in bash 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