臨時修改umask值,(umask 044;touch a.txt;ll a.txt)
[root@localhost ~]# (umask 044;touch a.txt;ll a.txt) -rw--w--w- 1 root root 0 Jul 29 00:12 a.txt
()表示在子shell中執行,不影響當前系統環境變量。
linux永久修改umask值,編輯/etc/profile
umask=022
保存后,重新加載/etc/profile生效。
source /etc/profile