How to delete regularly expired files in Linux
In Linux, you can simply delete expired files with the command:
find /home/ddos -type f -mtime +30 -exec rm -f {} \;
Parameter:
-
/home/ddos is the path to find files
- type f is to specify the file type as an ordinary file
-
-mtime +30 refers to the file whose modification time is 30 days from now
-
-exec rm -f means to delete the matched files without prompting.