-1

I have directory which have 777 permission on it . I want every directory to have the same permission that i created in it or will create in it.

  • 3
    777 is not a safe approach...If you still want to this, do a search in google like "how to set umask to a directory", you will certainly find what you need. – Eduardo Baitello Mar 08 '17 at 11:50
  • 1
    If your filesystem supports ACLs, you could set a default acl on directories to have special access righs set on newly created directories. See http://unix.stackexchange.com/questions/1314/how-to-set-default-file-permissions-for-all-folders-files-in-a-directory – ridgy Mar 08 '17 at 12:08

2 Answers2

0

I'd do something along these lines:

find directory/subdirectory -type d -exec chmod 755 {} \;

It doesn't really make sense as to why you'd want to do it though, why would you want all the files to be executable?

0

You can use umask 0777 to do this.

  • That's quite broad, applies everywhere, and will cause problems for e.g. ssh and other processes that are strict about permissions. – thrig Mar 30 '17 at 01:47