[comp.unix.questions] Difference of 'mtime' and 'ctime'

ghe@nucthy.physics.orst.edu (Guangliang He) (03/09/89)

In the man page of 'find' command, you can find the following two options,

          -mtime n        True if the file has been modified in n
                          days.

          -ctime n        True if the file has been changed in n days.

Can any one out there tell the difference of these two options? 

Thanks in advance.
***********************************************************************
                                   *                                   
USMAIL:   Guangliang He            *   INTERNET: ghe@PHYSICS.ORST.EDU  
          Department of Physics    *   BITNET:   hegl@orstvm.bitnet   
          Oregon State University  *                                   
          Corvallis, OR 97331      *   PHONE:    (503) 754-4631        
                                   *                                   
***********************************************************************

washer@lll-winken.LLNL.GOV (Jim Washer) (03/11/89)

In article <9316@orstcs.CS.ORST.EDU> ghe@nucthy.physics.orst.edu (Guangliang He) writes:
>In the man page of 'find' command, you can find the following two options,
>
>          -mtime n        True if the file has been modified in n
>                          days.
>
>          -ctime n        True if the file has been changed in n days.
>
>Can any one out there tell the difference of these two options? 
>


the svid entry differs from you message. It states

	-ctime n	True if the file *INODE* has been changed in n days

----------------------------------------------------------------------------
		James Washer
		North West Software Enterprises
		uunet!lll-winken!nwse!washer
----------------------------------------------------------------------------

les@chinet.chi.il.us (Leslie Mikesell) (03/13/89)

In article <9316@orstcs.CS.ORST.EDU> ghe@nucthy.physics.orst.edu (Guangliang He) writes:

>          -mtime n        True if the file has been modified in n
>                          days.
>          -ctime n        True if the file has been changed in n days.
>Can any one out there tell the difference of these two options? 

Mtime is the modification time of the contents of the file itself.  Ctime
is the modification time of the inode, which will include things like
mv'ing the file as well as anything that changes mtime (but not atime).

Les Mikesell

morrell@hpsal2.HP.COM (Michael Morrell) (03/14/89)

/ hpsal2:comp.unix.questions / ghe@nucthy.physics.orst.edu (Guangliang He) /  7:26 pm  Mar  8, 1989 /
In the man page of 'find' command, you can find the following two options,

          -mtime n        True if the file has been modified in n
                          days.

          -ctime n        True if the file has been changed in n days.

Can any one out there tell the difference of these two options? 
----------

Try reading the stat(2) man page where it describes the st_ctime and st_mtime
fields.  My documentation describes "st_ctime" as the "Last file status change
time".

guy@auspex.UUCP (Guy Harris) (03/14/89)

>the svid entry differs from you message. It states
>
>	-ctime n	True if the file *INODE* has been changed in n days

Which, in practice, tends to mean "the file has been changed in n days,
or the file has been renamed in n days, or a link to the file has been
added or removed in n days, or the permissions have been changed in n
days, or the owner has been changed in n days, or...." Basically, either
the file itself has been changed, or any of the changable attributes
that "stat" returns, with the possible exception of the accessed time,
has been changed. 

ric@Apple.COM (Ric Urrutia) (03/14/89)

In article <9316@orstcs.CS.ORST.EDU> ghe@nucthy.physics.orst.edu (Guangliang He) writes:
>In the man page of 'find' command, you can find the following two options,
>
>          -mtime n        True if the file has been modified in n
>                          days.
>
>          -ctime n        True if the file has been changed in n days.
>
>Can any one out there tell the difference of these two options? 
>
>Thanks in advance.


ctime is the date and time when the inode info changed last (such as link count, mode, uid, gid, etc.)

mtime is the date and time when the file contents changed
>***********************************************************************
>                                   *                                   
>USMAIL:   Guangliang He            *   INTERNET: ghe@PHYSICS.ORST.EDU  
>          Department of Physics    *   BITNET:   hegl@orstvm.bitnet   
>          Oregon State University  *                                   
>          Corvallis, OR 97331      *   PHONE:    (503) 754-4631        
>                                   *                                   
>***********************************************************************