Tuesday, 3 February 2009

Find files older than 3 days

This script finds all files with a modify time of 3 days ago or more.
It then uses the exec command to run a command on every match found,
it could easily be rm to remove files instead of listing them.


find /home/ -type f -mtime +3 -exec ls -l {} \;

No comments:

Post a Comment