![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum 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 |
| how to find ot ctime , mtime ,atime | nilesrex | Shell Programming and Scripting | 5 | 1 Week Ago 01:35 PM |
| Problem with find command when used with mtime | arunkumar_mca | UNIX for Dummies Questions & Answers | 4 | 01-07-2008 09:37 PM |
| problem with find and mtime | arunkumar_mca | UNIX for Dummies Questions & Answers | 4 | 11-05-2007 04:41 AM |
| find . -mtime | topcat8 | UNIX for Dummies Questions & Answers | 1 | 04-26-2006 07:55 AM |
| find -mtime +2? means after 48 hours.. | yls177 | UNIX for Dummies Questions & Answers | 1 | 11-08-2002 04:59 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
find -mtime off by one day?
If I use the find command to find files older than n days I have to enter
find . -mtime +(n-1). I tried this on a Solaris 9 system and also Linux. Is this something that all Unix veterans know about (I'm new to Unix)? If so, maybe my man pages need to be updated (how to do this?). |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Yes, you have to specify one day less. This is something that you should find in the man pages.
|
|
#3
|
|||
|
|||
|
No, the man pages don't describe this. I based my code on the man pages and now I have to change to it use n-1 instead of n. Who controls the Unix man pages and how do I get updates?
|
|
#4
|
||||
|
||||
|
From the manual pages for GNU find...
Code:
-atime n
File was last accessed n*24 hours ago. When find figures out how many 24-hour preiods
ago the file was last accessed, any fractional part is ignored, so to match -atime +1, a
file has to have been modified at least two days ago.
-mtime n
File's data was last modified n*24 hours ago. See the comments for -atime to understand
how rounding affects the interpretation of file modification times.
|
|
#5
|
|||
|
|||
|
Thanks, Ygor. The man pages on my Solaris and Linux systems don't have this text but they do behave as you described.
|
|||
| Google The UNIX and Linux Forums |