find:paths必须在表达式之前:find

时间:2017-12-28 20:43:40

标签: ubuntu terminal chmod

运行以下查找:

find . -exec chown apache:janderson {} \; find . -type f -exec chmod 0664 && find . -type d -exec chmod 0775 {} \;

但它产生了这个错误:

find: paths must precede expression: find

我该如何解决?

1 个答案:

答案 0 :(得分:0)

你是否试图找3次?添加分隔符:

find . -exec chown apache:janderson {} \; && 
    find . -type f -exec chmod 0664 {} \; && 
    find . -type d -exec chmod 0775 {} \; 

您在第一次和第二次&&来电之间缺少find;不作为分隔符,而是作为查找哪个用于终止exec的参数。