|
Using the find command is one way - check the man page as there are examples.
Just be careful about removing files older than 2 months as a system files are normally older than two months and could also be removed.
find ./ -name "*" -ctime +60 -exec rm {} \;
You can use ctime, atime or mtime
(Important - don't get the last part wrong as very bad things can happen!!! Try it some time on a test system.)
|