See When File Was Last Accessed in Linux

Last updated on Dec 28, 2019 in Linux

Linux uses three timestamps in a file: last access time, last modification time and last change time. They are briefly described below:

  • last access time (atime): file is accessed (opened) but not changed
  • last modification time (mtime): file’s content is changed
  • last change time (ctime): file’s content, permissions or name is changed

To see detailed timestamps of any file in Linux file system, you can use stat command:

$ stat
  File: `'
  Size: 22              Blocks: 8          IO Block: 4096   regular file
Device: 800h/2048d      Inode: 2331722     Links: 1
Access: (0654/-rw-r-xr--)  Uid: (  500/webadmin)   Gid: (   48/  apache)
Access: 2019-06-15 10:16:30.302003301 +0000
Modify: 2019-06-15 10:16:30.302003301 +0000
Change: 2019-12-28 15:51:09.906630209 +0000

The line Access: 2019-06-15 10:16:30.302003301 +0000 tells that the file was last accessed on 15th of June 2019 at 10:16 AM.

To change the timestamp, read article Change File Date in Linux With Touch