LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command to find and remove all files from /tmp direct that are older than 5 days old (http://www.linuxquestions.org/questions/linux-newbie-8/command-to-find-and-remove-all-files-from-tmp-direct-that-are-older-than-5-days-old-4175413864/)

vaibhavs17 06-28-2012 12:32 PM

command to find and remove all files from /tmp direct that are older than 5 days old
 
I tried this

does it look correct?

find . -mtime +5 -exec rm {} /tmp/\;

montel 06-28-2012 12:50 PM

Try this:

Code:

find /tmp/* -mtime +5 -exec rm {} \;
Source: HowToGeek


All times are GMT -5. The time now is 12:31 AM.