How Do I Change the Umask in Linux?
Contents

Check the current logged in user by running id command. Now change the umask value to 0002 by running umask 0002 command as shown below. Check again the umask value to confirm if it is changed.

How do I change my umask?

To change your umask during your current session only, simply run umask and type your desired value. For example, running umask 077 will give you read and write permissions for new files, and read, write and execute permissions for new folders.

How do I use the umask command in Linux?

To view the current umask value, we use the umask command. Running the umask command by itself provide the default permissions that are assigned when a file or folder is created. To change these values, we will use the following command.
…
The Umask Command Syntax.

Number Permission
2 write
1 execute
Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest