批量修改目录权限的办法

Debian NAS跑了几天,猛然发现目录权限的设置有问题,没有给组用户加x权限,导致用非所有者的帐号登录samba后无法列出目录中的文件。现在要把所有目录的权限由0740改为0750。在网上搜了一下找到这两种写法:

find -type d -exec chmod 750 {} \;
find -type d|xargs chmod 750

第一种写法试了,OK,第二种还没有试过。

Leave a Reply

Your email address will not be published. Required fields are marked *