[X-Unix] find and (c|m)time

David Ledger dledger at ivdcs.demon.co.uk
Sun Mar 29 02:31:24 PDT 2009


At 19:00 -0400 28/3/09, TjL wrote:
>If I am looking for files in a specific folder which were CREATED more
>than 24 hours ago, should I be using
>find . -type f -ctime +1 -print
>or
>find . -type f -mtime +1 -print
>AFAICT, 'atime' is reset by using 'find' itself, which I don't want.

Yes, atime is last accessed time.

>For as long as I've used Un*x, you'd think I'd know this one, but 
>I'm not sure.
>      -ctime n
>              True if the difference between the time of last change 
>of file status information and
>              the time find was started, rounded up to the next full 
>24-hour period, is n 24-hour
>              periods.
>      -mtime n
>              True if the difference between the file last 
>modification time and the time find was
>              started, rounded up to the next full 24-hour period, is 
>n 24-hour periods.

ctime is most likely right. The creation time is not kept under Unix, 
and I don't know it the HFS+ created time can be accessed by 
modifications to standard Unix commands. ctime will be the time of 
the latest chmod, chown, ..., which will be the creation time if none 
of the metedata has been changed since.

David


-- 
David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
david.ledger at ivdcs.co.uk
www.ivdcs.co.uk


More information about the X-Unix mailing list