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 can i copy files by date last modifed range? geauxsaints UNIX for Advanced & Expert Users 4 05-25-2008 08:06 AM
How to display files that have been modifed between a given date range prathima UNIX for Dummies Questions & Answers 1 04-02-2008 08:24 AM
automated ftp script from unix -date range of files koduri0475 Shell Programming and Scripting 1 11-10-2005 06:50 AM
cp only files in certain date range ee7klt UNIX for Dummies Questions & Answers 1 06-27-2005 06:35 PM
Moving Files within a particular date range rooh UNIX for Dummies Questions & Answers 3 03-18-2002 06:59 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-04-2007
Registered User
 

Join Date: Sep 2007
Posts: 3
Search files between a date range

Hi people

A newbie here, thrown into the deep end. I want to select the group of files with in a range of dates and perform some operation on it. Are there inbuild date libraries i can use?

I did read thru the old posts on this topic. Couldnt get much idea , basically want to know how I can increment the dates or how unix does that, date formats (ddmmyy, dd MM yyyy, etc.), etc. I reckon the solution would be to find the right switched with 'find'. Pl help.

Thanx
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-04-2007
Registered User
 

Join Date: Aug 2007
Posts: 13
you can use touch and find implement it.
Reply With Quote
  #3 (permalink)  
Old 09-05-2007
Registered User
 

Join Date: Aug 2007
Location: Bangalore
Posts: 285
You can use find command in this.
just do a
man find
and go through that,it will solve ur problem.

Thanks
Namish
Reply With Quote
  #4 (permalink)  
Old 09-05-2007
Registered User
 

Join Date: Sep 2007
Posts: 3
date formats

yup thanx. i figured that out. im using somehting like this -

touch -d "$1" ./tmp1
touch -d "$2" ./tmp2
find -name '*.cdr' -newer ./tmp1 ! -newer ./tmp3

1. I'm required to have the start/end dates in the format ddmmyyyy but touch seems to take only dd MMM or dd MMM yyyy. Can change/set the date format??

2. '-newer' retreives the file created *after* creation date on tmp1. I want to search for the files created *on or after* creation of tmp1. how would I do that?

Thanx ppl.
Reply With Quote
  #5 (permalink)  
Old 09-05-2007
Registered User
 

Join Date: Aug 2007
Posts: 13
1.touch only can accept its own time format, so you may adjust you to fit it. use -t parameter can adjust to minute(or second, it determind by your OS)
2.in fact, '-newer' retreives the file *on or after*, you can try it on your machine.

btw: what's ppl?
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:12 AM.


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

Content Relevant URLs by vBSEO 3.2.0