How can I reset permission to default according to the mask, so they will have permissions set as the file was just created
Example of what I want to achieve:
umask
is set to 0022
so
touch file
mkdir directory
file's permissions now are rw-r--r--
directory's permissons now are rwxr-xr-x
chmod 777 file
chmod 777 directory
file's permissions now are rwxrwxrwx
directory's permissions now are rwxrwxrwx
is there a way to reset perms back to default so file will be rw-r--r--
and directory rwxr-xr-x
using chmod
?