7/27/2022, 11:55:13 AM
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
and maxdepth
stop find
from crashing if there are too many filesmtime
specifies instructs find
to filter the files by the last modified time. +90
means 90 daysdelete
is self-explanatory