The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to find files older than 2 hours pt14 AIX 3 03-05-2008 09:31 AM
unix command/s to find files older than 2 hours in a directory Presanna Shell Programming and Scripting 6 11-20-2007 06:22 AM
Deleting Files Older than 24 hours mazhar803 SUN Solaris 7 09-27-2007 04:30 AM
Finding only those files older than 2 hours mh53j_fe UNIX for Dummies Questions & Answers 2 07-01-2005 06:33 AM
Finding files older than 2 hours ianf Shell Programming and Scripting 1 05-27-2002 07:51 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-16-2005
Registered User
 

Join Date: Jun 2005
Posts: 21
removing files after 6 hours or older

What is the command to remove files that are generated 6 hours or older? The find and remove tells only how to remove if the file is one day old or more. Appreciate quick reply. Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 08-16-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,699
Here is a starting point for you.

Check out these posts.
One
Two
Three

After you get the find command, use the following -exec rm {} \; along with it.

Vino
Reply With Quote
  #3  
Old 08-22-2005
Registered User
 

Join Date: Jun 2005
Posts: 21
removing files, 6 hours or older

The files are generated automatically. Is there a way you touch the files(multiple of them) that are automatically generated without manual intervention?
Reply With Quote
  #4  
Old 08-22-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,328
Check this link. The script takes as arguments the duration in nm or nh for the minutes or the hours, the directory where the files are located, and whether older files are required or newer ones.
Also, check the FAQs. The technical FAQ area has the link to this page. This has a lot of advanced uses of the find command.

Please go through the substantial resources that this site has before asking common questions.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0