Question

I am confused between the term file modification time and file changed time. Can anyone help to make it clearer?

Was it helpful?

Solution

mtime is modification time - contents have changed.

ctime is status change time - perms and ownership as well as contents.

Wikipedia says:

* mtime: time of last modification (ls -l),
* ctime: time of last status change (ls -lc) and
* atime: time of last access (ls -lu).

Note that ctime is not the time of file creation. Writing to a file changes its mtime, ctime, and atime. A change in file permissions or file ownership changes its ctime and atime. Reading a file changes its atime. File systems mounted with the noatime option do not update the atime on reads, and the relatime option provides for updates only if the previous atime is older than the mtime or ctime. Unlike atime and mtime, ctime cannot be set with utime() (as used e.g. by touch); the only way to set it to an arbitrary value is by changing the system clock.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top