1

I added this to my ~/.bashrc file:

umask 077

So that every new file and directory has by default read, write and execute permissions. It does work with directories, but files only have write and read permissions.

How do I default give these permissions?

1

I don't believe it is possible to make the behavior you desire the default / general behavior. Look here for details regarding "base permissions". For files the base permission is 666 or rw-rw-rw while for directories it is 777 or rwxrwxrwx. umask may further restrict base permissions, but cannot grant additional access. In other words, umask cannot be used to set the execute bit on a file.

If you want this to be the default behavior for a specific file creation mechanism it may be possible to create a shell script or other mechanism that when invoked creates the file or directory and issues a chmod 007 on the file or directory.

There are likely security issues making every new file writeable and executable.

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.