asked on
Unix prune command. find perms and change
Trying to find the best way to find all files and dirs that have perms 400 600 or 700 and exclude all sub dirs called .snapshot. Is there a better way to do it than this below?
find /app/data -path '.snapshot' -prune -o -perm 700 -exec ls -l {} \; > list
find /app/data -path '.snapshot' -prune -o -perm 400 -exec ls -l {} \; >>list
find /app/data -path '.snapshot' -prune -o -perm 600 -exec ls -l {} \; >>list
Trying to find the best way to change all files with perms 700 400 or 600 to perms 775.
Would this do it or is there a better way?
find /app/data -path '.snapshot' -prune -o -perm 700 -exec chmod 750 {} \;
find /app/data -path '.snapshot' -prune -o -perm 400 -exec chmod 750 {} \;
find /app/data -path '.snapshot' -prune -o -perm 600 -exec chmod 750 {} \;