forgetting is the bane of my existence. don’t ask why. i’ve forgotten this syntax enough times that i should have it tattooed on my upper arm. in fact, I think i’ve posted it on my own site before and forgotten about that.
find /path/to/files* -mtime +5 -exec rm {} \;
the first argument is, of course, the path to the files that you’re looking to rid yourself. The first flag, -mtime, tells find to look for files older than a certain number of days. the whole “+5” would indicate five days from today (would -5 be five days in the future then? something to look up later). The second flag, -exec, will tell find to execute the following command when it gets a positive result. in this case, we’re “removing” (rm
Leave a Reply
You must be logged in to post a comment.