Changing Permission Defaults with umask

Every time you create a file, the Unix system applies default permissions for you. This is great because, for many uses, the default permissions will be just what you want. In other cases, though, you’ll want to specify different default permissions.

You can change the default permissions using umask. The umask command uses a numeric representation for permissions (as discussed in the previous section), but the numeric value you specify here is not the same as the one you’d use with chmod. (Don’t ask why. We assume that Batman and Robin got together and made this command usable only by the Wonder Twins when their powers were activated.) So you have to figure out the umask value for the permissions you ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.