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:
- linux find: missing argument to `-exec’
- Groovy executes the script command shell command [Solved]
- shell :syntax error: unexpected end of file
- [Solved] “/bin/bash^M: bad interpreter: No such file or directory”
- shell :syntax error: unexpected end of file
- [Solved] appium Error: A new session could not be created
- Shell script error newline syntax error near unexpected token
- Shell Error: bash: ./a.sh: /bin/bash^M: bad interpreter: No such file or directory [How to Solve]
- Python calls shell script: oserror: [errno 8] exec format err
- [Solved] OCI runtime exec failed……executable file not found in $PATH”: unknown