diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-06-04 09:14:47 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-06-04 09:14:47 +0200 |
commit | 32422d2b9001291d7136036581122cf4b4eec75c (patch) | |
tree | 356615063a97796665adfc71318573e790ca285d /Temporary set permissions with which new files are created.md | |
parent | 9bd8cdf2ecc2b60f873b393122b19985cbc4587c (diff) |
Diffstat (limited to 'Temporary set permissions with which new files are created.md')
-rw-r--r-- | Temporary set permissions with which new files are created.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Temporary set permissions with which new files are created.md b/Temporary set permissions with which new files are created.md new file mode 100644 index 0000000..a8c258e --- /dev/null +++ b/Temporary set permissions with which new files are created.md @@ -0,0 +1,16 @@ +--- +tags: + - bash +--- +[[Bash]] + +Using `umask` one can set the file permissions that are set when creating a new file. + +Maximum permissions allowed for files and directories are differerent: +- Files max: 0666 +- Dirs max: 0777 + +Thus take care when setting `umask` because the effect is different on files than directories. + +To get the correct mask, just subtract the mask from the maximum permissions. For example, mask 0066 would create files 0600 < 6 - 6 = 0. +This same umask would make directories with 0711.
\ No newline at end of file |