Assume that my umask is 0077.
I have a directory, foo
, that I want to have special permissions applied to it. All files I create in foo
should be world readable, and all directories should be world readable and executable.
Currently, if I create a file, it will be 0600, and a directory will be 0700:
$ cd foo/
$ touch file
$ mkdir directory
$ ls -l
drwx------ 2 nfm nfm 4096 2012-01-12 16:16 directory
-rw------- 1 nfm nfm 0 2012-01-12 16:15 file
I want the file to be 0644, and the directory 0755, regardless of my umask:
drwxr-xr-x 2 nfm nfm 4096 2012-01-12 16:16 directory
-rw-r--r-- 1 nfm nfm 0 2012-01-12 16:15 file
How can I achieve this?