The umask command

The umask command shows and sets the default permissions:

root@dell:~# umask
0022

The umask value is just that, a mask. It masks out the permissions you don’t want to give.The umask value is subtracted from the full permission set for an object. The full permission for a file is mode 666 (read/write permission for all), but for a directory it’s 777 (read/write/execute permission for all).

Thus, in the example, the file starts out with permissions 666, and the umask of 022 is applied, leaving a file permission of 644. The umask value is normally set in the /etc/profile startup file.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.