| Subcribe via RSS

Delete Files Older Than n Days

August 15th, 2008 Posted in System Administration


In Linux system you can delete old unused files (usually the session files in /tmp) all at once by running this command:

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

this command will delete files which is 5 days old, if you want to change the number of days to 3 days old, then you have to change +5 to +3 and run the command again.

Tags:

One Response to “Delete Files Older Than n Days”

  1. ridu Says:

    wew.. tengs for da info.. akan dipraktekan kalo udah pake linux.. hehehee


Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word