The umask Command

   

Korn Shell: Unix and Linux Programming Manual, Third Edition, The
By Anatole Olczak

Table of Contents
Chapter 9.  Miscellaneous Commands


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 

       
    Top
     



    Korn Shell. Unix and Linux Programming Manual, Third Edition
    Korn Shell. Unix and Linux Programming Manual, Third Edition
    ISBN: N/A
    EAN: N/A
    Year: 2000
    Pages: 177

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net