Operating System - HP-UX
1819974 Members
3511 Online
109607 Solutions
New Discussion юеВ

difference between -ctime and -mtime using find ?

 
SOLVED
Go to solution
Sammy_2
Super Advisor

difference between -ctime and -mtime using find ?

See Ex. below.
Why do I get no result when I use -ctime but
get -mtime works fine (yields 1 file as expected). What's the difference between two ?

# date
Thu Dec 15 10:22:23 EST 2005
# touch -mt 12011259 ahd_12_15_05.log
# ll ahd_12_15_05.log
-rwxr-xr-x 1 root sys 0 Dec 1 12:59 ahd_12_15_05.log
# find $APP_LOG -name 'ahd*log' -ctime +10

# find $APP_LOG -name 'ahd*log' -mtime +10
/opt/hpws/apache/logs/ahd_12_15_05.log
good judgement comes from experience and experience comes from bad judgement.
8 REPLIES 8
Jeff Schussele
Honored Contributor
Solution

Re: difference between -ctime and -mtime using find ?

Hi Sammy,

Simply put - mtime is last time of modification of the file itself & ctime is last time of modification of the metadata of the file - owenrship, perms, etc.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Victor Fridyev
Honored Contributor

Re: difference between -ctime and -mtime using find ?

Hi,

ctime - time of last modification of the inode (file created, mode changed, etc.)
mtime - time of last modification of the file (file created, file changed )

HTH
Entities are not to be multiplied beyond necessity - RTFM
Sammy_2
Super Advisor

Re: difference between -ctime and -mtime using find ?

thanks.
good judgement comes from experience and experience comes from bad judgement.
Jeff Schussele
Honored Contributor

Re: difference between -ctime and -mtime using find ?

Would it be too much to ask that if you put two questions in you assign points to them both?
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Frank de Vries
Respected Contributor

Re: difference between -ctime and -mtime using find ?

Hi Jeff
Good comment, I noticed this is going on
all weeks, newlings hitting questions,but
then run.

we need some education here !!
Look before you leap
Sammy_2
Super Advisor

Re: difference between -ctime and -mtime using find ?

The hp forum must be having problems. I got system unavailable both time i posted questiions but later found out both similiar questions posted anyway. Also assigned points but forum did not take it. I will try again.
good judgement comes from experience and experience comes from bad judgement.
Jeff Schussele
Honored Contributor

Re: difference between -ctime and -mtime using find ?

I would simply point new users to Patrick's fine Forum Etiquette doc - here:

http://66.34.90.71/ITRCForumsEtiquette/

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sammy_2
Super Advisor

Re: difference between -ctime and -mtime using find ?

FYI, I have a pretty good track record of assigning pts. If a member responds more than once, then I assign pts once to the reply that is most helpful and leave other replies blank.
Othewise, one could potentially get 30-40pts on one thread. I assume that is how it is suppose to work. Correct me if i am wrong.
good judgement comes from experience and experience comes from bad judgement.