0

I have one requirement in which when I create a directory I want to create it with 777 permission. I did all stuff but not able to do this, anybody knows how to do this? Then please share.

Suppose I have directory /home/sachin/dir.

Now I am creating one folder test under /home/sachin/dir.

mkdir /home/sachin/dir/test

It will create test folder with 775 permission which I do not want.

I don't want to use -m option with the mkdir command.

7ochem
  • 191
sam
  • 11

1 Answers1

0

You have to use umask command:

Execute this command for creating every file or directory with 777 permission for an interactive shell:

umask 000

If you want to make it permanent setting for a single user then execute following commands:

gedit ~/.profile

and add a new line as

 umask 000 

then save the file.

If you want to make it default setting for all users, then execute following commands:

sudo -H gedit /etc/profile

and add a new line as

 umask 000 

then save the file.

muru
  • 207,228
Faizan Akram Dar
  • 4,569
  • 1
  • 25
  • 31