Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to write a script remove files older than 5 days? 1

Status
Not open for further replies.

we2aresame

Technical User
Feb 10, 2003
128
CA
how to write a script remove files older than 5 days?
 
man find

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
To remove files older than 5 days, you can run the following command in the directory containing the files to be removed :

find . -type f -mtime +5 | xargs rm -f
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top