Link to home
Start Free TrialLog in
Avatar of lolaferrari
lolaferrariFlag for United Kingdom of Great Britain and Northern Ireland

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 {} \;

ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial