Frequent Question: How Do You Delete a File from a Specific Date in Linux?
Contents Find / -Name “” -Mtime +1 -Exec Rm -F {}; Specify Path, Filename and Time to Delete the File. How Do I Delete a File from Date? Delete Files with...
Find /
How do I delete a file from date?
Delete Files with Specific Extension
log” extension and modified before 30 days. For the safe side, first do a dry run and list files matching the criteria. Above command will delete only files having . log extension and last modification date is older than 30 days.
Must Read
How do I delete a 3 month file in Linux?
You can either use the -delete parameter to immediately let find delete the files, or you can let any arbitrary command be executed ( -exec ) on the found files. The latter is slightly more complex, but offers more flexibility if want to copy them to a temp directory instead of deleting.