资料介绍
Linux_Shell
第一章:shell基础
●umask --查看当前用户创建文件或文件夹时的默认权限
eg:
[test@szbirdora 1]$umask
0002
[test@szbirdora 1]$ls -lh
-rw-rw-r-- test test myfile
drwxrwxr-x test test 1
上面的例子中我们看到由test默认创建的文件myfile和文件夹1的权限分别为664,775.
而通过umask查到的默认权限为002.所以可以推断出umask的计算算法为:
umask file directory
0 6 7
1 5 6
2 4 5
3 3 4
4 2 3
5 1 2
6 0 1
7 0 0
●连接ln
硬连接 ln sourcefile targetfile
连接后的target文件大小和source文件一样
软连接 ln -s sourcefile targetfile