|
|||||||||
| UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers |
unix and linux operating commands |
| Tags |
| find -newer |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Create a list of files that were modified after a given date.
Hello Mates! I'm kinda new to unix and need to a solve a problem.
Input: date Situation: With the given date I need to find a list of all such files starting from a given path that were modified after the given date. I experimented with the "find" with "-newer" but did not quite get it to work. Any clarifications through examples appreciated! Any other pointers on how to solve this would be helpful!! Thanks in advance! Cheers!! |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
please check like this :
Code:
find . -ctime +30 -exec ls -l {} \;Last edited by Yogesh Sawant; 02-14-2011 at 07:46 AM.. Reason: added code tags |
| Sponsored Links | ||
|
|
|
#3
|
||||
|
||||
|
thanks for the reply.
please could you explain the "-ctime +30" portion. I dont get it. |
|
#4
|
||||
|
||||
|
"-atime/-ctime/-mtime" the last time a files's "access time", "file status" and "modification time", measured in days or minutes. Time interval in options -ctime, -mtime and -atime is an integer with optional sign.
* n: If the integer n does not have sign this means exactly n days ago, 0 means today. * +n: if it has plus sing, then it means "more then n days ago", or older then n, * -n: if it has the minus sign, then it means less than n days ago (-n), or younger then n. It's evident that -1 and 0 are the same and both means "today". * Examples: o Find everything in your home directory modified in the last 24 hours: + find $HOME -mtime 0 o Find everything in your home directory modified in the last 7 days: + find $HOME -mtime -7 o Find everything in your home directory that have NOT been modified in the last year: + find $HOME -mtime +365 o To find html files that have been modified in the last seven days, I can use -mtime with the argument -7 (include the hyphen): find . -mtime -7 -name "*.html" -print If you use the number 7 (without a hyphen), find will match only html files that were modified exactly seven days ago: find . -mtime 7 -name "*.html" -print o To find those html files that I haven't touched for at least 7 days, I use +7: find . -mtime +7 -name "*.html" -print |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
hey mate! that was a real eye opener. i was getting a bit put off by the description in the man files...
thanks again!! cheers!! |
| Sponsored Links | ||
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Finding modified File List after the chosen date in Korne Shell... | marconi | Shell Programming and Scripting | 2 | 01-22-2008 05:27 AM |
| list exe files modified before certain dates | fremont | UNIX for Dummies Questions & Answers | 2 | 05-25-2007 10:29 AM |
| how to know year create/modified files? | blesets | UNIX for Dummies Questions & Answers | 5 | 03-10-2007 12:20 AM |
| list last 10 days modified files | arunkumar_mca | UNIX for Dummies Questions & Answers | 1 | 10-12-2006 05:09 AM |
|
|