linux - test if all files in directory have correct permissions -


how can test if files in directory have correct permissions ? using command stat --format %a /home/user/dir/* can permissions of files in directory in multi line string. let's want check if files have permissions 0700.

i use if [ "$(stat --format %a ~/file)" != 600 ]; chmod 0600 ~/file; fi single file, how can test multiple files ?

could try this?

for in ~/your_dir/*/*  if [ "$(stat --format %a $i)" != 600 ];   chmod 0600 $i  fi done 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -