The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find 3 months old log files and remove cvdev SUN Solaris 13 05-22-2008 02:38 PM
Deleting the files comparing the creation dates pssandeep UNIX for Dummies Questions & Answers 2 04-10-2008 11:54 AM
Files and dates mastachef UNIX for Dummies Questions & Answers 1 12-03-2007 02:12 PM
Last modification times of files less than 6 months old Abhishek Ghose UNIX for Dummies Questions & Answers 1 10-19-2005 08:37 AM
Listing files older than 2 months pbekal Shell Programming and Scripting 3 01-17-2002 02:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-07-2005
godalle godalle is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 3
deleting files with dates 3 months ago

please help me with this?????

i need to create a program that will run in unix that will delete all files in a given directory that is at least 3 months old. first the program will need to automatically know what date it is right now to determine the files it will delete...guys help me please
  #2 (permalink)  
Old 11-08-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Use the forum's search feature.

command unix to list all files created since n month ago
Listing files older than 2 months
  #3 (permalink)  
Old 11-08-2005
andryk's Avatar
andryk andryk is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2003
Posts: 448
try this:
Code:
find the_directory -type f -ctime +90 -exec rm -f {} \;
  #4 (permalink)  
Old 11-08-2005
godalle godalle is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 3
hey guys thanks a lot;

Just thinking if i can use the same code with the same result using korn shell, will this program work as well:


#!/bin/ksh

find /export/home/zzgodae/archive -type f -ctime +90 -exec rm -f {} \;




thanks again

Last edited by godalle; 11-08-2005 at 04:27 AM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0