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’ {} \;

Similar Posts: