The shell's built-in command exec does not start the new shell, but instead uses the command to be executed to replace the current shell process and to clean up the old process's environment, and the other commands after the EXEC command will no longer execute. So, if you are in a shell and execute exec LS then, when the current directory is listed, the shell exits itself because the shell process has been replaced by a process that simply executes the LS command, and the execution ends naturally. exec must take \; End. exec is followed by a level two execution command.
An option for the Find command, as follows: (1) in the current directory (including subdirectories), find all txt files and find the line containing the string "bin" find./-name "*.txt"-exec grep "bin" {} \;
(2) in the current directory (including subdirectories), find the log file 10 days before the find./-name ". Log"-mtime +10-exec ls {} \; ({} and \; there are spaces, \ and; there are no spaces between them, they are connected)
(3) in the current directory (including subdirectories), delete the log of the 10 days ago find./-name ". Log"-mtime +10-exec rm {} \;
(4) in the current directory (including subdirectories), delete all txt files find./-name "*.txt"-exec rm {} \;
Linux command find and exec federated use