Sentence notation:
Find corresponding directory-mtime + days-name "file name"-exec rm-rf {} \;
Example 1: Place all 10 days before the/usr/local/backups directory with "." The file deletion
Find/usr/local/backups-mtime +10-name "* *"-exec RM-RF {} \;
Find:linux the Find command, the user finds the file for the specified condition
/usr/local/backups: Any directory that you want to clean up
-mtime: Standard statement notation
+10: Find files 10 days ago, where the number represents the number of days, +30 means to find files 30 days ago
"* *": The type of data you want to find, "*.jpg" means to find all files with the extension jpg, "*" means to find all the files, this can be used flexibly, extrapolate
-exec: Fixed notation
RM-RF: Forcibly deleting files, including directories
{} \; : fixed notation, pair of curly braces + spaces +\
Example 2: Delete all 5-day files in the/var/spool/clientmqueue directory
find/var/spool/clientmqueue/-type f-exec rm-rf {} \;
A find command for Linux with RM deletes files from a day ago