find files which does not have 770 permissions
I need a script which can throw an error if there are files in a directory which does not have permissions of 770. this should include directores which may contain empty folders.
If there are files which dont have the permission 770 ..the script need to throw an error.. Please can someone help. |
Hi zrux and wellcome to LQ,
the find-command should work for you. Look at man find and especially for the -perm option. Code:
find . -perm 770 -print Another way to make sure that all permissions within a directory are equal to 770 would be to use chmod with the -R option (look at man chmod). Markus |
thanks very much
But how do I find those files which are not printed by the above command? |
Code:
find . -type f -perm /o=x -ls |
Try this:
find <path> -perm 770 > 770.txt find <path> > all.txt diff -d all.txt 770.txt > diff.txt And then read diff.txt |
All times are GMT -5. The time now is 01:50 AM. |