[英]How to chmod all files in sub-directories without chmod the folders?
[英]Linux recursive chmod only on sub-directories
我在 linux,我有一個目錄,里面有許多子目錄和項目。 我想在所有目錄和子目錄上運行遞歸 chmod,但這些目錄中的文件都沒有。
chmod -R 777 {folder}
有沒有我可以添加到 chmod 命令的標志,使 chmod 僅適用於子目錄?
在我的頭頂上:
find {folder} -type d -print0 | xargs -0 chmod 777
find {folder} -type d -print0 | xargs -0 chmod 777
嘗試:
查找{文件夾} -type d -exec chmod 777 {} \;
直接來自手冊頁:
也在這里證實: https://stackoverflow.com/a/17091831/538512
使用以下格式或其衍生物chmod -R u=rwX,go=rwX {folder}
希望有幫助!
我們還可以運行以下命令遞歸更改所有文件夾的權限。
sudo chmod 777 -v $(find $PWD -type d)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.