Delete Files Older Than One year on Linux
By Emma Martinez •
By the time, many files are still on my system and I don't need them anymore, so how to delete all files that are one year old at least?
1 Answer
You can do it with this command
find /path/to/files* -mtime +365 -exec rm {} \;Some explain
/path/to/files* is the path to the files.
-mtime is used to specify the number of days old that the file is. +365 will find files older than 365 days which is one year
-exec allows you to pass in a command such as rm.
Edit Thanks to @Oli note --> you can do it by:
find /path/to/files* -mtime +365 -delete 4 More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"