Linux文件属性、权限设置
来源:互联网 发布:慢放视频软件 编辑:程序博客网 时间:2024/06/16 00:40
一 二 三 四 五 六 七 如: 如: 方式一 数字类型改变 语法: 同一组的数字是相加!如属性为 [ -rwxrwx--- ] ,则: [root@test root]# ls –al .bashrc [root@test root]# chmod u=rwx,og=rx .bashrc [root@test root]# ls –al .bashrc [root@test root]# chmod a-x .bashrc 文件属性和权限
total 64
drwxr-x--- 4 root root 4096 Feb 14 22:02 .
drwxr-xr-x 23 root root 4096 Feb 16 13:35 ..
-rw-r--r-- 1 root root 1210 Feb 10 06:03 anaconda-ks.cfg
-rw------- 1 root root 12447 Feb 14 23:22 .bash_history
-rw-r--r-- 1 root root 24 Jun 11 2000 .bash_logout
-rw-r--r-- 1 root root 234 Jul 6 2001 .bash_profile
-rw-r--r-- 1 root root 217 Feb 9 22:06 .bashrc
-rw-r--r-- 1 root root 210 Jun 11 2000 .cshrc
drwx------ 2 root root 4096 Feb 14 21:54 .gnupg
-rw------- 1 root root 8 Feb 14 22:05 .mysql_history
drwx------ 2 root root 4096 Feb 10 00:44 .ssh
-rw-r--r-- 1 root root 196 Jul 11 2000 .tcshrc
-rw-r--r-- 1 root root 1126 Aug 24 1995 .Xresources
[文件属性][节点数][作者][所属群组] [大小][创建时间] [文件名]改变权限设置:
chgrp :改变所属群组
chgrp 群组名 文件或目录
[root@test root]# chgrp users tmp
[root@test root]# ls –l
drwx------ 2 root root 4096 Oct 19 11:43 drakx/
drwx------ 2 root users 4096 Oct 19 21:24 tmp/
[root@test root]# chgrp testing tmp
chgrp: invalid group name `testing' <==出错信息!
chown :改变作者
*chown 可直接修改所属群組
chown [ -R ] 用户名 文件或目录
chown [ -R ] 用户名:群组名 文件或目录
[root@test root]# chown test tmp
[root@test root]# ls -l
total 28
drwx------ 2 root root 4096 Oct 19 11:43 drakx/
drwx------ 2 test users 4096 Oct 19 21:24 tmp/
[root@test root]# chown –R root:root tmp
[root@test root]# ls –l
drwx------ 2 root root 4096 Oct 19 11:43 drakx/
drwx------ 2 root root 4096 Oct 19 21:24 tmp/
chmod :改变权限属性
三个基本属性:r、w、x的数字类型代表:r:4、w:2 、x:1
chmod [-R] xyz 文件或目录
xyz 为三組 rwx 属性数值的相加
owner = rwx = 4+2+1 = 7
group = rwx = 4+2+1 = 7
others = --- = 0+0+0 = 0
-rw-r--r-- 1 root root 226 Feb 16 2002 .bashrc
[root@test root]# chmod 777 .bashrc
[root@test root]# ls –al .bashrc
-rwxrwxrwx 1 root root 226 Feb 16 2002 .bashrc
方式二 符号类型改变
g
o
a+(加入)
-(除去)
=(设定)r
w
x文件或目录
[root@test root]# ls –al .bashrc
-rwxr-xr-x 1 root root 226 Feb 16 2002 .bashrc
-rwxr-xr-x 1 root root 226 Feb 16 2002 .bashrc
[root@test root]# chmod a+w .bashrc
[root@test root]# ls –al .bashrc
-rwxrwxrwx 1 root root 226 Feb 16 2002 .bashrc
[root@test root]# ls –al .bashrc
-rw-rw-rw- 1 root root 226 Feb 16 2002 .bashrc
- Linux文件属性、权限设置
- Linux文件属性、权限设置
- Linux文件属性、权限设置
- Linux文件属性、权限设置
- Linux文件属性、权限设置
- linux文件属性及权限
- Linux文件属性与权限
- linux 文件属性与权限
- linux 文件属性与权限
- linux文件属性和权限
- linux 文件属性与权限
- linux文件属性与权限
- linux文件属性与权限
- linux 文件属性与权限
- linux文件属性与权限
- Linux文件属性与权限
- linux文件属性、权限
- linux 文件属性与权限
- IP TCP UDP ICMP IGMP检验和的计算方法
- Automatic Query Type Identification Based on Click Through Information
- EEPROM、EPROM、FLASH、SRAM、DRAM、SDRAM的区别
- Page.IsPostBack
- 2010年最具人气的100个小网站
- Linux文件属性、权限设置
- firefox下如何去掉flash与其他元素的空隙
- (PS)賭博黙示録カイジ汉化笔记(四)
- 财务指标(
- VC++6.0中错误"unexpected end of file while looking for precompiled...
- Bypass XSS filters (Paper)
- 【转】VC++ 堆和栈的区别
- android插入耳机
- ntop 抓包优化 PF_RING + TNAPI