See When File Was Last Modified in Linux

Last updated on Dec 28, 2019 in Linux

There are three timestamps in a file in Linux: last modification time, last access time and last change time:

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

To view timestamp details of a file in Linux, use stat command as follows:

$ stat README.md
  File: `README.md'
  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 Modify: 2019-06-15 10:16:30.302003301 +0000 tells that the file was last modified on 15th of June 2019 at 10:16 AM.

The line Change: 2019-12-28 15:51:09.906630209 +0000 telss that the file’s permissions or name was changed on 28th of Dec 2019 at 15:51 PM.

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