1、linux中的umask与文件和目录权限的关系
2016-03-09 09:48
746 查看
1、查看当前的umask值
2、修改当前umask的值
3、umask与目录和权限的关系
[@localhost test]$ umask
2、修改当前umask的值
[@localhost test]$ umask0002
[@localhost test]$ umask 0022
[i@localhost test]$ umask
0022
[@localhost test]$ umask 0002
[@localhost test]$ umask0002
3、umask与目录和权限的关系
#创建文件的权限 文件默认不能具有执行权限,如果算得的结果中有执行权限,则将其权限加1 666-umask 创建目录的权限 777-umask #创建新的文件 [root@localhost test]# umask 0022 [root@localhost test]# touch 1.c [root@localhost test]# ll total 0 -rw-r--r--. 1 root root 0 Apr 12 06:20 1.c #创建新的目录 -rw-r--r--. 1 root root 0 Apr 12 06:20 1.c [root@localhost test]# umask 0022 [root@localhost test]# mkdir testumask [root@localhost test]# ll total 4 -rw-r--r--. 1 root root 0 Apr 12 06:20 1.c drwxr-xr-x. 2 root root 4096 Apr 12 06:22 testumask
相关文章推荐
- centos top 命令详解及退出top命令-使用p键及free命令
- centos 为OPENJDK配置JAVA_HOME环境变量,安装MAVEN
- linux Qt无法自动加载数据库驱动
- Windows,Linux,Mac系统中,USB HID枚举过程的异同
- Linux设备驱动之mmap设备操作
- centos彻底删除mysql
- Linux查看系统配置常用命令
- linux驱动开发流程
- UltraEdit 和Notepad++ 使用ftp直接编辑linux上文件
- 关于Centos使用grub无法引导Windows的解决办法
- 微软将把 SQL Server 带到 Linux
- Linux 解压后的启动流程分析
- Linux 内核自解压流程分析
- linux 进程地址空间的一步步探究
- linux 标准IO缓冲机制探究
- linux 进程(一)---基本概念
- Linux系统中,read文件过程分析
- GemFire 入门篇2:GemFire 8.2 在CentOS & Mac OS X的安装步骤 - doubletree - 博客园
- Mac OS X & Linux下搭建Nrf51822开发环境与编译过程
- linux下c编程基础