Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有主文件夹,其中有多个文件夹和文件。主文件夹具有所有者 X 和组权限 Y。在其中所有文件夹和文件都具有所有者 X 和组权限 x。但我希望他们所有人都像主文件夹一样拥有组权限 Y。实现它的最短方法是什么?
这就是我需要解决的问题:
sudo chown -R username:group directory
如果要更改组,而不更改所有者,可以使用
chgrp -R GROUP FILE
只需使用将递归应用您的权限的 -R 选项(即父文件夹下的文件和文件夹)。它是这样的:
chmod -R <permissions> /myfolder