find is a very common Linux command, but what we generally find out is not just to look at it, there will be further operations, this time the role of exec is revealed.
e xec Explanation:
The-exec parameter is followed by command, which terminates with a; for the end of the flag, so the semicolon behind this command is indispensable, considering that the semicolons in each system have different meanings, so precede the backslash.
{} curly braces represent the file name found in the previous find.
In some operating systems only the-EXEC option is allowed to execute such as LS or LS -l such a command. Most users use this option to find old files and delete them. It is recommended that you take a look at the LS command before you actually execute the RM command to delete files, confirming that they are the files you want to delete. The  EXEC option is followed by the command or script that you want to execute, followed by a pair of { }, a space and a \, and finally a semicolon. In order to use the EXEC option, you must use the Print option at the same time. If you verify the Find command, you will see that the command outputs only the relative path from the current path and the file name
Example 1 : The ls-l command is placed in the-exec option of the Find command
command: find.-type f-exec ls-l {} \;
Example 2: find changes in the directory in N files and delete them before the day
command: find.-type f-mtime +14-exec rm {} \;
instance 3: Find the change time in the directory in n days ago Files and delete them prompt
before deleting
command: find.-name "*.log"-mtime +5-ok rm {} \;
instance 4: -exec Use the grep command
command: find/etc-name "passwd*"-exec grep "root" {} \;
Example 5: Find files move to the specified directory
Command:find-name "*.log"-exec mv {}..
Example 6 : executing the CP command with the EXEC option
command: find.-name "*.log"-exec cp {} test3 \;
Linux Basic command (--find) exec of command