Musings of an anonymous geek

September 17, 2007

UNIX mtime vs. ctime

Filed under: Linux,Sysadmin,Technology — m0j0 @ 8:27 am

Sometimes I get questions from people about stuff that I’ve long since taken for granted. One is “what’s the difference between mtime and ctime?”

The answer is simple, but I wanted to post it here in case it can help anyone. In UNIX:

mtime is “modification time”, and it is the time at which the last modification *TO THE CONTENT* of the file was made.

ctime is “change time”, and it is the time at which the last modification *TO THE PROPERTIES* of the file was made. By “properties” I mean things like ownership and permissions.  You can think of this as “chtime” – the last time a “ch*” command like chown, chmod, or chgrp was performed on the file.

Advertisements

2 Comments »

  1. […] Searching on Google about this, I found a good explanation about this on this blog. […]

    Pingback by UNIX mtime vs. ctime | — June 29, 2012 @ 3:25 pm | Reply

  2. […] (IIRC). The 20+ year leagy of Unix not really supporting creation times on files reliably. (Quick, what’s the difference between mtime and ctime? And why is atime such a bad idea for web servers?) ext4fs has a new attribute called “birth […]

    Pingback by all my music albums sorted by date | nelsonslog — November 8, 2014 @ 4:09 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: