How can I set default group owner & permissions for any new file created under /data/user-name/ ?

I want any new file created under /data/user-name/ to have the following properties: 1) group owner = marketing 2) owner permissions = rwx 3) group permissions = rwx 4) other permissions = r--

touch /data/user-name/test.file
ls -lah /data/user-name/test.file

should produce

-rwxrwxr--  1 username marketing     0B Apr  7 13:23 test.file

I cannot figure out how to accomplish this. Thank you!!!


The default permissions for a new file are 0666, i.e. rw-rw-rw-. These permissions can be reduced, i.e masked off, using umask. There is no default mechanism to add execute permissions when creating a file.

  • Wow, ok. Thank you! That may be ok for my use-case. There might be some masking settings on my server, then. Do you know how to apply default group owner to new files under a directory? – Super_John Apr 8 '17 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.