![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl: Extracting date from file name and comparing with current date | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 12:01 PM |
| Move A File With Same Date,don't Change The Desitination Dir Date | jee.ku2 | UNIX for Dummies Questions & Answers | 1 | 01-09-2008 09:42 AM |
| Changing Creation Date to a Prespecified Date of a File In Unix | monkfan | UNIX for Dummies Questions & Answers | 4 | 11-28-2006 03:15 AM |
| Append a field to the end of each line of a file based on searching another file. | ultimate | Shell Programming and Scripting | 2 | 03-29-2005 07:21 AM |
| Shell Script for searching files with date as filter | kanakaraj_s | Shell Programming and Scripting | 3 | 05-14-2002 08:15 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
searching a file by date...
It's possible to use "find" to search a file that was modified for example between 5/10/2004 and 7/11/2005? How can i do this? I saw there is option -mtime, but i don't understand how to use it in this case. Thanks
|
| Forum Sponsor | ||
|
|
|
||||
|
Quote:
-atime The time the file was last accessed -ctime The time the file's status last changed -mtime The time the file was last modified -newer Newer than ... touch -t 200410060000 /tmp/newerstart touch -t 200511070000 /tmp/newerend find . \( -newer /tmp/newerstart -a \! -newer /tmp/newerend \) -print Unix Review > John & Ed's Miscellaneous find Tips UNIX tips: Productivity tips |
|
|||
|
Change the date to a format touch can use, then add one day, and subtract one day
Code:
touch ./old -t 200801100000 # jan 10 2008 at one second after midnight touch ./new -t 20080102359 # jan 10 2008 23 hours 59 find /path/to/files \( -newer ./old -a ! -newer ./new\) -print |
|||
| Google UNIX.COM |