Why are the backslash and semicolon required with the find command's -exec option?

后端 未结 2 2066
自闭症患者
自闭症患者 2020-11-27 16:43

I have begun to combine different commands in the linux terminal. I am wondering why the backslash and semicolon are required for a command such as:

find ./          


        
2条回答
  •  情深已故
    2020-11-27 17:38

    from "man find":

    All following arguments to find are taken to be arguments to the command until an argument consisting of ';' is encountered.

    find needs to know when the arguments of exec are terminated. It is natural to terminate a shell command with ; because also the shell uses this character. For the very same reason such a character must be escaped when inserted through the shell.

提交回复
热议问题