1. An extremely helpful I have found for deleting files that are older than x number of days in a directory.

      findĀ /path/to/files -mtime +5 -exec rm {} \;

      So basically to run this command you simply need to update the path to your files and set the number of days. The number of days old is set in place by the +5 part of the command. So in other words, this command will delete all files in the /path/to/files that are 5 days or older.

      I would encourage you to run the command like this to make sure you are only going to delete the file you intend to delete. You know measure twice cut once!

      findĀ /path/to/files -mtime +5

      1. jack

        That's very handy to delete backup files!(automatically via cron)

        December 28, 2010 - 8:38 pm