Linux umask命令

Linux 教程 · 2019-02-14 08:28:23

Linux umask命令指定在建立文件时预设的权限掩码。

umask可用来设定[权限掩码]。[权限掩码]是由3个八进制的数字所组成,将现有的存取权限减掉权限掩码后,即可产生建立文件时预设的权限。

语法

umask [-S][权限掩码]

参数说明:

-S  以文字的方式来表示权限掩码。

实例

使用指令"umask"查看当前权限掩码,则输入下面的命令:

$ umask                         #获取当前权限掩码 

执行上面的指令后,输出信息如下:

0022

接下来,使用指令"mkdir"创建一个目录,并使用指令"ls"获取该目录的详细信息,输入命令如下:

$ mkdir test1                       #创建目录  
$ ls –d –l test1/                   #显示目录的详细信息  

执行上面的命令后,将显示新创建目录的详细信息,如下所示:

drwxr-xr-x 2 rootlocal rootlocal 4096 2011-9-19 21:46 test1/ 

注意:在上面的输出信息中,"drwxr-xr-x"="777-022=755"。

点击查看所有 Linux 教程 文章: https://www.codercto.com/courses/l/14.html

查看所有标签

Introduction to Graph Theory

Introduction to Graph Theory

Douglas B. West / Prentice Hall / 2000-9-1 / USD 140.00

For undergraduate or graduate courses in Graph Theory in departments of mathematics or computer science. This text offers a comprehensive and coherent introduction to the fundamental topics of graph ......一起来看看 《Introduction to Graph Theory》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

MD5 加密
MD5 加密

MD5 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器