文件权限与目录配置练习

[root@localhost ~]# chgrp users intstll.log
chgrp: 无法访问 “intstll.log”: 没有那个文件或目录
[root@localhost ~]# chgrp users install.log
[root@localhost ~]# ls -l
总计 44
-rw------- 1 root root    827 09-13 00:57 anaconda-ks.cfg
-rw-r--r-- 1 root users 14056 09-13 00:57 install.log
-rw-r--r-- 1 root root   3058 09-13 00:57 install.log.syslog
-rw-r--r-- 1 root root     20 09-18 17:11 trest.txt
[root@localhost ~]# chgrp testing install.log
chgrp: 无效的组 “testing”
[root@localhost ~]# chown bin install.log
[root@localhost ~]# ls -l
总计 44
-rw------- 1 root root    827 09-13 00:57 anaconda-ks.cfg
-rw-r--r-- 1 bin  users 14056 09-13 00:57 install.log
-rw-r--r-- 1 root root   3058 09-13 00:57 install.log.syslog
-rw-r--r-- 1 root root     20 09-18 17:11 trest.txt
[root@localhost ~]# chown root:root install.log
[root@localhost ~]# ls -l
总计 44
-rw------- 1 root root   827 09-13 00:57 anaconda-ks.cfg
-rw-r--r-- 1 root root 14056 09-13 00:57 install.log
-rw-r--r-- 1 root root  3058 09-13 00:57 install.log.syslog
-rw-r--r-- 1 root root    20 09-18 17:11 trest.txt
[root@localhost ~]# ls -al .bashrc
-rw-r--r-- 1 root root 176 2007-01-06 .bashrc
[root@localhost ~]# chmod 777 .bashrc
[root@localhost ~]# ls -al .bashrc
-rwxrwxrwx 1 root root 176 2007-01-06 .bashrc
[root@localhost ~]# chmod u=rwx,go=rx .bashrc
[root@localhost ~]# ls -al .bashrc
-rwxr-xr-x 1 root root 176 2007-01-06 .bashrc
[root@localhost ~]# chmod a+w .bashrc
[root@localhost ~]# ls -al .bashrc
-rwxrwxrwx 1 root root 176 2007-01-06 .bashrc
[root@localhost ~]# chmod a-w .bashrc
You have mail in /var/spool/mail/root
[root@localhost ~]# chmod a-x .bashrc
[root@localhost ~]# ls -al .bashrc
-r--r--r-- 1 root root 176 2007-01-06 .bashrc
[root@localhost ~]#

 

posted @ 2016-01-03 01:12  苍天博客  阅读(284)  评论(0编辑  收藏  举报