最常用的命令是:chmod +x file,表示给文件赋可执行权限。
例子:
实例1:增加文件所有用户组可执行权限
命令:
chmod a+x log2012.log
输出:
[root@localhost test]# ls -al log2012.log
-rw-r--r-- 1 root root 302108 11-13 06:03 log2012.log
[root@localhost test]# chmod a+x log2012.log
[root@localhost test]# ls -al log2012.log
-rwxr-xr-x 1 root root 302108 11-13 06:03 log2012.log
[root@localhost test]#
说明:
即设定文件log2012.log的属性为:文件属主(u) 增加执行权限;与文件属主同组用户(g) 增加执行权限;其他用户(o) 增加执行权限。
chmod命令的使用及文件的权限,参考文章:
http://www.cnblogs.com/peida/archive/2012/11/29/2794010.html