Server Fault is a question and answer site for system and network administrators. 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

I wish to have something in my .bashrc that will mask the file permissions as 022 (resulting in new files having permission rwxr--r--) and the directory permissions as 066 (resulting in new directories having permission rwx--x--x).

Is this possible?

share|improve this question

You can't do that. Having a directory with just x allows others (with suitable permissions) to run programs within the directory but not list the contents of it. What are you trying to achieve ?

share|improve this answer
Not actually quite correct -- execute permissions on a directory allow access to its contents. A directory set 711 will allow users to enter the directory and view files if they know the name, but won't allow ls. – duskwuff Jul 8 '11 at 17:21

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.