Delete Files Older Than x Days



The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them.
find /path/to/files* -mtime +5 -exec rm {} \;
Note that there are spaces between rm, {}, and \;

The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results.
The second argument, -mtime, is used to specify the number of days old that the file is. If you enter +5, it will find files older than 5 days.
The third argument, -exec, allows you to pass in a command such as rm. The {} \; at the end is required to end the command.

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

15 comments:

GST Training said...

What you're saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I'm sure you'll reach so many people with what you've got to say.

Buy Contact Lenses said...

I really appreciate your professional approach. These are pieces of very useful information that will be of great use for me in future.

Tangki Fiber said...

Definitely believe that which you said. Your favorite reason appeared to be on the web the easiest thing to be aware of. I say to you, I definitely get irked while people think about worries that they just do not know about. You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people could take a signal. Will likely be back to get more. Thanks
Tangki Panel

2 player games said...

This is truly a decent and instructive, containing all data furthermore greatly affects the new innovation

Priya Sharma said...

I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work...
Delhi Escorts
Delhi Call Girls

Unknown said...

Your site fantastic, superior quality succeed... Most probably various should realize others despite that they don't take time to advise you.
Bathmate
best penis pump

jacke arce said...

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
bathmate penis pump

Sonam Sharma said...

You will find cases where the girl asks him to feel that this up and sets her customer's hand.
Call Girl In Delhi

Aditi Sharma said...

Welcome to Surat escorts service for female escorts in Surat. Surat escorts are available at 09925100066 . Find beautiful & sexy escorts for anywhere.
Surat escort
Escort Service Surat
Call Girls in Surat
Escort in Surat
Surat Escort Service
Escort Service in Surat
Independent Surat Escort
Independent Escort Service Surat
Surat Russian Escorts
surat escort service
Surat Call Girls

Aditi Sharma said...

Independent Udaipur Escorts
Housewife Escorts in Jaipur
Lucknow Escorts
Hyderabad Escorts Service
Kolkata Escorts
Pune Escort Girls
Russian Call Girls in Andhery
VIP Bandra Escorts
Bangalore Escorts
Chennai Escorts

Aditi Sharma said...

Surat escort girls available for your booking in all areas of Surat. Browse genuine Surat escorts portfolios, reviews and choose different types of escort Air-Hostess, House Wife Escorts, College Girls Escorts, Indian Model Escorts.
Surat escort
Escort Service Surat
Call Girls in Surat
Escort in Surat
Surat Escort Service
Escort Service in Surat
Independent Surat Escort
Independent Escort Service Surat
Surat Russian Escorts

Aditi Sharma said...

surat escort service
Surat Call Girls
Surat escort
Escort Service Surat
Call Girls in Surat
Escort in Surat
Surat Escort Service
Escort Service in Surat
Independent Surat Escort
Independent Escort Service Surat

Aditi Sharma said...

Surat Russian Escorts
surat escort service
Surat Call Girls
Surat escort
Escort Service Surat
Call Girls in Surat
Escort in Surat
Surat Escort Service
Escort Service in Surat

No #1 Gurgaon Escorts Service Agency-Gurugram said...




Also known to come with crucial offerings for its sensible, down-to-earth and important clients,Escorts Service in Gurgaon really means in fulfilling their lives with cheerful moments to make love in concern to ensure them live their lives in abetter way. Check our other Services...
Russian Call Girls in Gurgaon
Russian Escorts in Gurgaon
Russian Escorts in Gurgaon
Call Girls in Gurgaon
Call Girls in Gurgaon

Unknown said...



Our Call Girls in Ahmedabad have smooth bodies that can prepare you for a night of sexual loving. You don’t want to feel self-conscious as you’re safe here at our Call Girls agency. Our Services are all-time service that is accessible for you 24*7 hours. Our Escorts Girls are always prepared to make you fill you’ll have a fantastic alluring night with our lovely girls and you only need for believing simultaneously. Check our other Services also...
Independent Call Girls in Ahmedabad
Ahmedabad Call Girls Service
Call Girls in Hotels in Ahmedabad
Escorts in Ahmedabad
Escorts Service in Ahmedabad
Housewife Escorts in Ahmedabad
Hi Profile Escorts in Ahmedabad

Post a Comment

Popular Posts