The UNIX and Linux Forums  


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
Search files between a date range zcanji Shell Programming and Scripting 7 05-27-2009 01:31 PM
search by modified date kotasateesh Shell Programming and Scripting 4 06-24-2008 10:59 AM
date search thirumaran Shell Programming and Scripting 5 09-24-2007 03:54 AM
Shell script: last modification date for a file onlyc UNIX for Dummies Questions & Answers 4 07-06-2006 02:01 PM
command for modification date of a file scampsd UNIX for Dummies Questions & Answers 5 12-28-2005 08:14 AM

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 05-24-2006
slink slink is offline
Registered User
  
 

Join Date: May 2006
Posts: 3
Search by modification date

Hi

I'd like to know if is it possible to find files given a certain modification date (say, 01-05-2006, that's 1st of May 2006)

I can calculate the days backward:

Code:
find / -ctime 23
but I wish to search by exact modification day


Thanks
  #2 (permalink)  
Old 05-24-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,240
Substitue mtime for ctime in your command.
  #3 (permalink)  
Old 05-24-2006
slink slink is offline
Registered User
  
 

Join Date: May 2006
Posts: 3
mtime makes more sense than ctime because it considers the file last modification time instead of change of file status, but I still get the same results

I would express my question as:

How can I find files modified on 01-05-2006 on my computer?
  #4 (permalink)  
Old 05-25-2006
skarthik_d skarthik_d is offline
Registered User
  
 

Join Date: May 2006
Posts: 3
Dunno if I understood your question right, but anyway try below.

Find no of days difference (Difference.Days=Current.Date-Search.Date [E.g, No.of.days.difference between 20060525 and 20060520 is 5]). Say you wanna search your file in a directory called "XXX" exactly 5 days before.

find XXX -mtime 5 -depth -type f

The above command will list you all files in XXX modified 5 days before.

Karthik
  #5 (permalink)  
Old 05-25-2006
slink slink is offline
Registered User
  
 

Join Date: May 2006
Posts: 3
Yes, if I want to search files modified 5 days ago in my computer I type:

Code:
find / -mtime 5 2>/dev/null
the 2>/dev/null is just to prevent output about "Permission denied" directories

But, what if I want to search for files modified on 01-01-1999 ?
  #6 (permalink)  
Old 05-25-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,240
See the section in the FAQ on date manipulation.
Closed Thread

Bookmarks

Tags
mtime

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 07:16 PM.


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