Xubuntu [SOLVED]: find: paths must precede expression: find

Xubuntu [SOLVED]: find: paths must precede expression: find

Home Forums Xubuntu Xubuntu [SOLVED]: find: paths must precede expression: find

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36867

    Anonymous

    QuestionQuestion

    Running the following find:

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

    But it’s generating this error:

    find: paths must precede expression: find
    

    How do I fix?

    #36868

    Anonymous

    Accepted AnswerAnswer

    Are you trying to run find 3 times? Add a separator:

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

    You are missing the && between the first and second find calls. The ; does not act as a separator, but as an argument to find which serves to terminate the exec.

    Source: https://stackoverflow.com/questions/48014128/find-paths-must-precede-expression-find
    Author: William Pursell
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.