将目录的所有文件和文件夹权限更改为 644/755 [英] Change all files and folders permissions of a directory to 644/755

查看:27
本文介绍了将目录的所有文件和文件夹权限更改为 644/755的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 linux 命令提示符下使用 chmod 将所有文件更改为 644,并将所有文件夹更改为 755?(终端)

How would I change all files to 644 and all folders to 755 using chmod from the linux command prompt? (Terminal)

推荐答案

一种方法可能是使用 find:

One approach could be using find:

find /desired_location -type d -print0 | xargs -0 chmod 0755

用于文件

find /desired_location -type f -print0 | xargs -0 chmod 0644

这篇关于将目录的所有文件和文件夹权限更改为 644/755的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆