Sometimes you just need to prune a directory of all files older than a certain age. Think log files, or uploaded files... maybe ~/Downloads
, perhaps?
find . -mindepth 1 -maxdepth 1 -mtime +90 -delete
mindepth
andmaxdepth
stopfind
from crashing if there are too many filesmtime
specifies instructsfind
to filter the files by the last modified time.+90
means 90 daysdelete
is self-explanatory