File Times (mtime, ctime, atime)

By Paulus, 21 February, 2009

Unlike Windiws, you can not determine when a file was created. Instead, you can only determine three things:

  1. atime -- the time in which a file was accessed. This includes viewing the contents of the file or executinng a shell script.
    $ cat example_file
  2. ctime -- the time in which a file's inode (owner, group, and permissions) and when the file's contents were last changed. To view the files ctime with the ls command use the -lc flags.
    $ chown root:root example_file
  3. mtime -- is the time in which a files conntents have been modified. This differs from the ctime as it will not reflect when the permissions were modified.
    $ echo "Hello!" >> example_file