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
Post a Comment