I'm new to Linux. I have been practicing a few commands. My question is about when I'm creating different files using a different umask. For example:
umask 222, as I understand it, is the same as 777 - 222 = 555, so when I create a new file (call it "newfile"), then newfile's permissions should be r-xr-x-r-x (or am I wrong?)
Whatever: "newfile" was created with r--r--r-- permissions.
My umask value in /etc/profile is:
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
My uid is 1002.
Note: Just for the record, I've already read all the umask questions and documentation from man and I can't understand it yet.
$ umask 0000;# no output;$ touch myfile && chmod a+x myfile;# no output;$ ls -ld myfile ; -rwxrwxrwx 1 me my_group 0 Sep 18 18:29 /tmp/new.txt# <-output