^1640692625630
@
sname
filePermission
slabel
文件权限管理
stype
thingDesc
sgroup
Linux常用命令.常用命令
sicon
icons/html.png
Sdescription
#$@text#$@
<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:18px"><strong>文件权限管理</strong></span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">三种基本权限</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">R &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 读 &nbsp; &nbsp; &nbsp; &nbsp; 数值表示为4</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">W &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;写 &nbsp; &nbsp; &nbsp; &nbsp; 数值表示为2</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">X &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 可执行 &nbsp;数值表示为1</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px"><img alt="" src="http://images.cnitblog.com/blog/352072/201402/091549405142313.png" style="border-image:none; border:0px currentColor; max-width:900px" /></span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">如图所示，jdk-7u21-linux-i586.tar.gz文件的权限为-rw-rw-r--</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">-rw-rw-r--一共十个字符，分成四段。</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">第一个字符&ldquo;-&rdquo;表示普通文件；这个位置还可能会出现&ldquo;l&rdquo;链接；&ldquo;d&rdquo;表示目录</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">第二三四个字符&ldquo;rw-&rdquo;表示当前所属用户的权限。 &nbsp; 所以用数值表示为4+2=6</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">第五六七个字符&ldquo;rw-&rdquo;表示当前所属组的权限。 &nbsp; &nbsp; &nbsp;所以用数值表示为4+2=6</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">第八九十个字符&ldquo;r--&rdquo;表示其他用户权限。 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;所以用数值表示为2</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif"><span style="font-size:14px">所以操作此文件的权限用数值表示为662</span><span style="font-size:14px">&nbsp;</span></span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif"><strong><span style="font-size:14px">更改权限</span></strong></span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">sudo chmod [u所属用户 &nbsp;g所属组 &nbsp;o其他用户 &nbsp;a所有用户] &nbsp;[+增加权限 &nbsp;-减少权限] &nbsp;[r &nbsp;w &nbsp;x] &nbsp; 目录名&nbsp;</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">例如：有一个文件filename，权限为&ldquo;-rw-r----x&rdquo; ,将权限值改为&quot;-rwxrw-r-x&quot;，用数值表示为765</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">sudo chmod u+x g+w o+r &nbsp;filename</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">上面的例子可以用数值表示</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">sudo chmod 765 filename</span></p>
#$@text#$@
sdescriptors
xworker.lang.content.QuickContent
sinheritDescription
false
sth_createIndex
true
sth_registThing
command|xworker.jsch.JCtermRootWord
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
