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

I have set the umask to 0.


I do
echo 'test' > test.txt
And test.txt is created. If I do: ls -l test.txt I see:
$ls -l test.txt
-rw-rw-rw- 1 jim None 5 Jun 30 22:50 test.txt
Why aren't the rights rwxrwxrwx?

share|improve this question
The shell doesn't set the x bit for newly created files. – ott-- Jun 30 '13 at 23:50
up vote 4 down vote accepted

The shell uses 0666 for the default permissions when creating a new file. As umask only removes permissions, never adds them, that is what the resultant file will have.

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.