Quote:
Originally Posted by haertig
Of course they do. They store ctime, mtime and atime (creation time, last modification time, last access time). The creation time is the time when the file was created on your system, unless you specified to use the creation time from the original computer you imported the file from.
|
ctime is not file creation time—that’s a common mistake made by new Unix users.
ctime is the inode change time. Any change to the inode info will update the ctime, even if the file remains unchanged. For instance, a chown or chmod on a file updates the ctime.
Code:
$ echo "Test" > test.txt
$ ls -clt test.txt # File was created at 16:20
-rw-rw-r-- 1 user group 5 Jan 15 16:20 test.txt
$ chmod g-w test.txt # Change permissions at 16:21
$ ls -clt test.txt # File was still created at 16:20, but ctime tracks the inode change not the creation time
-rw-r--r-- 1 user group 5 Jan 15 16:21 test.txt
$ cat test.txt # File is unchanged; still the same one created at 16:20
Test