The umask Command

The umask command sets the file-creation mask using this format:

					umask
					mask
				

where mask is an octal number or symbolic value that correspond to the permissions to be disabled. Here, the write and execute permissions for group and others are removed:

					$ umask 033
					$ touch tmp
					$ ls -l tmp
					-rw-r--r--  1 root 9 Sep  2 11:18 tmp
				

This umask command adds write permission to the group:

					$ umask 013
					$ touch tmp1
					$ ls -l tmp1
					-rw-rw-r--  1 root 9 Sep  2 11:19 tmp1
				

To remove read permission for other using symbolic format:

					$ umask o-r
					$ touch tmp2
					-rw-rw----  1 root 9 Sep  2 11:23 tmp2
				

With no arguments, umask displays the current value. This umask is set to remove write permission for group and others:

					$ umask
					022
				

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.238.205