How Do I Delete a File from a Specific Date in Unix?
Contents How Do You Delete Files Older Than a Certain Date in Unix? How to Delete Files Older Than 30 Days in Linux Delete Files Older Than 30 Days. You Can...
Contents
How do you delete files older than a certain date in Unix?
How to Delete Files Older than 30 days in Linux
- Delete Files older Than 30 Days. You can use the find command to search all files modified older than X days. …
- Delete Files with Specific Extension. Instead of deleting all files, you can also add more filters to find command. …
- Delete Old Directory Recursively.
Must Read
How do I delete a 5 day old file in Unix?
4 Answers
- Also use -type f to delete files only (and keep sub directories) – Oleg Mar 4 ’16 at 8:44.
- Alternatively, if you want to do the same for all files NEWER than five days: find /path/to/directory/ -mindepth 1 -mtime -5 -delete – zmonteca Apr 19 ’16 at 17:29.