Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

In ubuntu, I use a program written by others. This program creates a file on my system and try to read and write it later. But the permission of the file it creates is read-only. How can I change the default permission when creating a file in ubuntu, in home folder. Thanks ahead.

share|improve this question
It depends on the program you use. The program would create a file and set its permissions. So, unless you change the source code, you can't do much other than manually changing the permissions. –  green7 Apr 17 '13 at 15:31
I tried to create a file by using vi. The owner is me. Files created by the program belong to root. Can I do something to change that? –  user1524111 Apr 17 '13 at 15:36
Post the output of umask. –  green7 Apr 17 '13 at 15:59
the output is 0002 –  user1524111 Apr 17 '13 at 18:10
And the output of echo $USERNAME? Also, what command do you use to create a file using vi ? –  green7 Apr 17 '13 at 18:20

1 Answer 1

I got the answer with green7's help. When I use sudo with other commands, the owner is root and when I use command without sudo, the owner is me.

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.