I am using the below script as a clean up script. The find sections returns the correct results, but for some reason the -exec section doesn’t run.
find /users/rhysparker/downloads/ -maxdepth 1 -iname \*.pkg -o -iname \*.app -o -iname \*.dmg -exec mv {} /folder/location/ \;
Any help would be appreciated.
The
-ooperation has low precedence, so your-execis bound exclusively to the*.dmgtest. Use parentheses to group the statement properly. (And quote them so the shell passes them through tofind).