Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何递归使用名称中带有空格字符的chmod目录_Linux_Command Line_Chmod - Fatal编程技术网

Linux 如何递归使用名称中带有空格字符的chmod目录

Linux 如何递归使用名称中带有空格字符的chmod目录,linux,command-line,chmod,Linux,Command Line,Chmod,不起作用,给出“没有这样的文件或目录”如果您只想执行递归,请使用-R find . -type d | xargs chmod 770 这就是你想要的吗: chmod -R 770 dir_path 如果只想执行递归,请使用-R find . -type d | xargs chmod 770 这就是你想要的吗: chmod -R 770 dir_path 您想使用find的print0选项来处理文件名中的空格 find . -type d | xargs -I {} chmod -R

不起作用,给出“没有这样的文件或目录”

如果您只想执行递归,请使用
-R

find . -type d | xargs chmod 770
这就是你想要的吗:

chmod -R 770 dir_path

如果只想执行递归,请使用
-R

find . -type d | xargs chmod 770
这就是你想要的吗:

chmod -R 770 dir_path

您想使用
find
print0
选项来处理文件名中的空格

find . -type d | xargs -I {} chmod -R 770 "{}"
为什么不直接使用
-R
选项:

find . -type d -print0 | xargs chmod 770

您想使用
find
print0
选项来处理文件名中的空格

find . -type d | xargs -I {} chmod -R 770 "{}"
为什么不直接使用
-R
选项:

find . -type d -print0 | xargs chmod 770

谢谢,我忘了只提目录应该是770,文件应该是644。这完全没有意义,如果目录不能被所有人读取,你为什么要授予文件读取权限。。无论如何,请使用
print0
查看更新。这仍然会给出“没有这样的文件或目录”不应该是双qoutes吗?谢谢,我忘了提到只有DIR应该是770,文件应该是644。这完全没有意义,如果目录不能被所有人读取,为什么您要授予文件读取权限。。无论如何,请使用
print0
查看更新。这样仍然会显示“没有这样的文件或目录”是否应该是双qoutes?谢谢,但只有目录应该是双qouteseffected@user1981297如果对你有效,请接受有效的答案。要接受答案,请单击投票箭头正下方的勾号。谢谢,但只应显示目录effected@user1981297如果对你有效,请接受有效的答案。要接受答案,请单击投票箭头正下方的勾号。