Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


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 !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-04-2012
Registered User
 
Join Date: Apr 2009
Location: Chennai
Posts: 122
Thanks: 1
Thanked 0 Times in 0 Posts
Find only files that changed Yesterday

Hi ,

I know that find / -type f -mtime -1 will show all modified files that changed 24hrs preceeding the time i run the command. This will include list of files that changed today.

How do i find only files that changed yesterday staring from 00:00hrs to 23:59?

Thanks
HG

Last edited by radoulov; 07-04-2012 at 03:26 AM.. Reason: code tags
Sponsored Links
    #2  
Old 07-04-2012
Registered User
 
Join Date: Jul 2012
Posts: 30
Thanks: 0
Thanked 1 Time in 1 Post
Try this...

find . -mtime 1
Sponsored Links
    #3  
Old 07-04-2012
elixir_sinari's Avatar
Gotham Knight
 
Join Date: Mar 2012
Location: India
Posts: 1,370
Thanks: 87
Thanked 476 Times in 456 Posts
There may be other ways but you could use this. Touch 2 reference files with modification times as follows:


Code:
touch -t 201207022359.59 refstart
touch -t 201207040000.00 refend

and then use:


Code:
find . -type f -newer refstart \! -newer refend \! -name refend

This will show all the files modified on 3rd July, 2012. You could modify the time-stamps to suit your needs. If you have GNU date, then you could do it dynamically too.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to find out who changed the file permission in unix Uttamnsd UNIX for Dummies Questions & Answers 7 01-27-2012 01:12 PM
Find why CPU utlization WAS high yesterday kashif_islam Solaris 4 09-26-2011 01:24 AM
Find recently changed files raghu_shekar UNIX for Dummies Questions & Answers 3 07-06-2010 05:26 AM
Using the find command to copy yesterday date only files Colel2 UNIX Desktop for Dummies Questions & Answers 4 05-28-2009 08:18 PM
Find a file modified yesterday and print it! Ariean UNIX for Dummies Questions & Answers 5 12-27-2008 09:08 PM



All times are GMT -4. The time now is 10:34 AM.