How Do I Delete 7 Day Old Logs in Linux?
Contents How Do I Delete 7 Days Old File in Linux? the Find Utility on Linux Allows You to Pass in a Bunch of Interesting Arguments, Including One to Execute...
Contents
How do I delete 7 days old file in Linux?
The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them.
Must Read
How do I get rid of logs older than 7 days?
Explanation:
- find : the unix command for finding files/directories/links and etc.
- /path/to/ : the directory to start your search in.
- -type f : only find files.
- -name ‘*. …
- -mtime +7 : only consider the ones with modification time older than 7 days.
- -execdir …
24 февр. 2015 г.