I have tried the following:
Code:
~$ install -m 666 -d /tmp/aaa/bbb/ccc
~$ ls -lda /tmp/aaa
drwxr-xr-x 3 user group 60 Aug 7 10:24 /tmp/aaa
~$ ls -lda /tmp/aaa/bbb
drwxr-xr-x 3 user group 60 Aug 7 10:24 /tmp/aaa/bbb
~$ ls -lda /tmp/aaa/bbb/ccc
drw-rw-rw- 2 user group 40 Aug 7 10:24 /tmp/aaa/bbb/ccc
we can see aaa and bbb were created using umask and only ccc was created using the flags given (-m 666).
Is there any way to set the given permissions of all the dirs - not only the last one, but all the parents (of course I can write a script to do that). Is there any way to introduce a new flag (something like -r as recursive, -f force to set)? Does it make any sense?