1

You can set an arbitrary time using the touch command, is there a way to get the real modified time of a file?

1 Answer 1

2

What touch can set is the “atime” or “mtime”. POSIX systems also track the “ctime”, “inode change time”. Several alternatives for getting it:

$ ls -lc _file_
$ stat -c %z _file_
$ perl -MDate::Format -e '@_ = stat $ARGV[0]; print ctime $_[10]' _file_

Any change to the file's data or metadata (hard link count, permissions, etc.) sets the “ctime”.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .