首页|嵌入式系统|显示技术|模拟IC/电源|元件与制造|其他IC/制程|消费类电子|无线/通信|汽车电子|工业控制|医疗电子|测试测量
首页 > 分享下载 > 消费类电子 > Linux_Shell脚本的编写

Linux_Shell脚本的编写

资料介绍
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          
标签:LinuxShell
Linux_Shell脚本的编写
本地下载

评论