如何设置权限 drwxr-xr-x 到其他文件夹?

use*_*349 30 linux permissions chmod

我在如下文件夹中几乎没有目录 -

teckapp@machineA:/opt/keeper$ ls -ltrh
total 8.0K
drwxr-xr-x 10 teckapp cloudmgr 4.0K Feb  9 10:22 keeper-3.4.6
drwxr-xr-x  3 teckapp cloudmgr   4.0K Feb 12 01:44 data
Run Code Online (Sandbox Code Playgroud)

我在其他一些机器上还有一些其他文件夹,我需要像这样更改上述文件夹的权限drwxr-xr-x

这意味着如何将任何文件夹权限更改为drwxr-xr-x?我知道我需要chmod对此使用命令,但是我应该为此使用 chown 的值是多少?

agu*_*slr 47

要将这些权限应用于目录:

chmod 755 directory_name

应用于当前目录内的所有目录:

chmod 755 */

如果要修改所有目录和子目录,则需要将findchmod结合使用:

find . -type d -exec chmod 755 {} +


ser*_*sat 10

对于 drwxr-xr-x,它是:

chmod 755  the_path_to_target
Run Code Online (Sandbox Code Playgroud)

对于 drwxrwxr-x,它是:

chmod 775  the_path_to_target
Run Code Online (Sandbox Code Playgroud)