Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Plenty of examples on how to set umask for a user... but how do you read (or uncover) the default umask for a given user (say the logged in user)

share|improve this question
Note that umask is not associated with a user but with a process. – Stéphane Chazelas Jan 28 '13 at 21:31
ic. so what I think I want, ideally, is for the umask to change to 002 whenever I run a particular command ($ brew …) but it can default back to 022 at all other times. possible or wishful thinking? – Meltemi Jan 28 '13 at 23:56
up vote 5 down vote accepted

With the umask command...

dennis@lightning:~$ umask
share|improve this answer
LOL- well, that was easy (read: obvious)! thx – Meltemi Jan 28 '13 at 21:25

To make sure a command is called with a specific command, you could wrap it inside a script or a function that starts a subshell with the umask updated. You could put that function definition in your shell configuration file like .bashrc for bash or .zshrc for zsh.

Something like:

brew() (
  umask 002 &&
    command brew "$@"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.