Daily Archives: 十月 12th, 2007

修改目录下所有子目录权限为755其他文件权限为644

find . -type d -exec chmod 755 {} \;
find . -not -type d -exec chmod 644 {} \;
find . -type d | xargs chmod 755
find . -not -type d | xargs chmod 644

find -exec 需要 ;结尾

举例
find . -type d -exec ls -ld {} \;
如果没有 \;表示结束,系统会认为-exec还没有结束