如何更改文件夹的权限

如何更改文件夹的权限

linux下如何更改文件夹的权限?chmod -777 aa这样可以吗?
手册上说:
<?php
// Read and write for owner, nothing for everybody else
chmod ("/somedir/somefile", 0600);

// Read and write for owner, read for everybody else
chmod ("/somedir/somefile", 0644);

// Everything for owner, read and execute for others
chmod ("/somedir/somefile", 0755);

// Everything for owner, read and execute for owner's group
chmod ("/somedir/somefile", 0750);
?>
如履薄冰
假设设置目录为/www
1.为用户加权限

[复制到剪切板]
CODE:
chown -R apache:apache /www ;

2.chmod

[复制到剪切板]
CODE:
+w 为加写权限.
+
r 为加读权限.
+
x 为可执行.
....
man chmod一下看手册.
-
w为去掉写.
-....
同理. ;

学习,支持