日期:2014-05-16 浏览次数:20706 次
[root@pinfun6 tmp]# ll filename -rwxrwxrwx 1 root root 0 Apr 15 14:37 filename [root@pinfun6 ~]# chmod 0755 filename [root@pinfun6 tmp]# ls -l filename -rwxr-xr-x 1 root root 0 Apr 15 14:37 filename
[root@pinfun6 tmp]# ll filename -rwxrwxrwx 1 root root 0 Apr 15 14:37 filename [root@pinfun6 tmp]# chmod u=r-x[,o=r-x] filename [root@pinfun6 tmp]# ll filename -r--rwxrwx 1 root root 0 Apr 15 14:37 filename
[root@pinfun6 tmp]# ll filename -rwxrwxrwx 1 root root 0 Apr 15 14:37 filename [root@pinfun6 tmp]# chmod g-w,o-w filename [root@pinfun6 tmp]# ll filename -rwxr-xr-x 1 root root 0 Apr 15 14:37 filename
[root@pinfun6 tmp]# chmod g+w filename [root@pinfun6 tmp]# ll filename -rwxrwxr-x 1 root root 0 Apr 15 14:37 filename
三、修改文件目录的属主、属组
chown [OPTION]... [OWNER][:[GROUP]] FILE...
chgrp [OPTION]... GROUP FILE...
[root@pinfun6 tmp]# chown root filename #修改属主 [root@pinfun6 tmp]# chown :root filename #修改属组 [root@pinfun6 tmp]# chgrp root filename #修改属组 [root@pinfun6 tmp]# chown root:root filename #修改属主和属组