Mit*_*ran 4 linux permissions shell file
我需要将以下权限策略应用于我的文件www夹下的文件
664递归地向www中的所有文件,递归地在www下的所有目录中的755
我试过了
find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;
Run Code Online (Sandbox Code Playgroud)
但总是得到错误
find: missing argument to `-exec'
Run Code Online (Sandbox Code Playgroud)
解决办法是什么?
分号前的反斜杠(或围绕它的引号):
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
Run Code Online (Sandbox Code Playgroud)
shell看到你输入的分号作为命令的结尾并且没有传递给它find,然后抱怨它丢失了.