Does anyone have a good shell line for this?
I want to check the age on a directory. If I created multiple directories on a weekly basis and I want to purge them/delete them based on 7 days later for example.
How would I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This will let you do a dry run, remove the
echoif you like the outputUpdate
If you have an older version of
findthat doesn’t comply with POSIX 2004 then use this instead:or
The former terminated by
\;will callrmfor each directory it finds, the latter withxargswill attempt to callrmas few times as possible by passing multiple directories to a single call tormand thus be much faster. The latter also has identical behavior to the first one terminated with a+