atime, mtime, and ctime

On traditional Unix-style file systems three timestamps are associated with each file. These timestamps are atime, ctime, and mtime. Most people understand atime as “access time.” A file is accessed when its content is viewed or is executed. ctime and mtime generate confusion since “change time” and “modification time” seem synonymous. However, what you need to focus on is what is being changed. The mtime value is updated when the actual contents of the file are changed. However, updating mtime, also updates ctime. This does not mean an update to ctime will cause an update to mtime. The ctime value is updated when the files inode or change to the files content are made. For example:

# cat foo
Hello, World

Will update the files atime, but it will not effect the ctime or mtime.

# chmod 777 foo

Will update the files ctime but not the files atime or mtime.

# echo “Goodbye, World!” > foo

Will update the files ctime and mtime but not the files atime.

No related posts.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.