stat (display file status)
This command is most commonly used to view a file's timestamps. Run it like this:
Here is some shortened sample output:
Access: 2013-06-01 16:38:16.826633169 +0200
Modify: 2013-05-17 20:10:50.610638063 +0200
Change: 2013-06-08 11:46:32.773597389 +0200
We see that the file notes.txt was last accessed on 1 June 2013, etc. The differences between the three kinds of timestamps are:
- Access time: The time when a file was last read.
- Modification time: The time when a file was last written to.
- Change time: The time when a file's status (e.g. its ownership) was last changed.
The information given by stat is highly dependent on the file system and →mount options used. If a file system was mounted with the noatime option, for example, no access times will be recorded.