When you want to delete certain files for example with „.CR2” extension. Open „Terminal” and write correct path and extension, like this:
find /Users/YourUserName/Desktop/photography -name ‚*.CR2’ -delete
This command will remove all files which will match ‚*.CR2’ pattern in selected folder (example „/Users/YourUserName/Desktop/photography”) and subfolders.
I use this to delete image RAW files. I’m also deleting .xmp files.
Keep Your Mac clean 😉