Strace

strace (trace system calls)

griffon:~$ rm testfile
griffon:~$ umask 077; strace -eopen touch testfile 2>&1 | tail -1; ls -l testfile
open("testfile", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY|O_LARGEFILE, 0666) = 3
-rw-------  1 greg greg 0 2005-03-11 10:01 testfile
As before, touch doesn't care what the umask is. It just calls open(2) with the desired permissions of 0666, 
and the kernel applies the umask. Our umask in this case is 0077, or ---rwxrwx, so those are the permissions 
we cross out. All that's left are the rw- for the owner; the group and other permissions are all taken away, 
and we have rw------- (0600).

Source: http://wooledge.org:8000/Permissions

To add: other strace tutorials/docs

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License