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?

  • 1
    The shell doesn't set the x bit for newly created files. – ott-- Jun 30 '13 at 23:50

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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