Tag Archives: find: missing argument to `-exec’

Linux Error: missing argument to `-exec’ [How to Solve]

When using the find command under linux, an error is reported: find: missing argument to `-exec’

The specific execution command is:

Shell code Collection code
find /u03 -name server.xml -exec grep ‘9080’ {}\;
The purpose is to find the file named server.xml in the /u03 directory, perform a grep search according to the search results, and search for text containing 9080.

The syntax format of -exec is:

Shell code Collection code
-exec command {} \;
There must be a space between {} and \, otherwise the above error will be reported.

Re-execute the command after adding a space:

Shell code Collection code
find /u03 -name server.xml -exec grep ‘9080’ {} \;

linux find: missing argument to `-exec’

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

When using the find command in Linux, an error is reported: find: missing argument to ‘- exec’

The specific execution commands are as follows:

Shell code

find/u03-nameserver.xml-execgrep’9080′{}\;

The purpose is to find the file named server.xml in the directory of/u03, and grep search is carried out according to the search results, which contains 9080 text

-The format of exec is:

Shell code

-execcommand{}\;

There must be a space between {} and \, otherwise the above error will be reported

Re execute the command after adding a space:

Shell code

find/u03-nameserver.xml-execgrep’9080′{}\;