permission for all the files in a folder

Hi Guys,

Is there a command or some way whenever any file is created in a folder is having a default permission.

Cheers!!!

You can set a default permissions mask with umask for the current shell.
Though, you can't set execute permissions as default. Default is 0022 - issuing umask without parameters will show you the actual set mask.

Additionally setting the SGID-bit with chown to a directory will inherit the group of the directory to the files created in there. Maybe this helps.

  • if you have said "any file in any folder", then
umask

would suffice.

  • when you need some mode - or permission - to be inherited by files in just one specific directory, that's when acl (access control list) comes to the aid.

  • as I do not know what flavour of unix you are using, try

man getacl
man setacl

or

man getfacl
man setfacl
  • one of these will do.

HTH

good luck, and success.

alexandre botao
("comets never dodge")