Delete the file specified date Linux command to delete the file specified date

Reference links: Linux command to delete the file specified date

 

# Clean up the current directory file 90 days prior to the end of .log

find -name "*.log" -mtime +90 -exec rm {} \;

 

 

Examples

# Find the file content changes occur on documents within two days of
 the Find / var / log / Hive / -name " * " -mtime - 2  

 

# 5 days before the delete files 
# - exec parameters have returned to find if the command can be combined with the need to operate in the exec parameter with the search results {} instead of
 Find / var / log / Hive / -name " * " - + the mtime . 5 -exec RM -rfv {} \;

 

Guess you like

Origin www.cnblogs.com/victorfrost/p/12614643.html