In Linux (currently using ext4 filesystem), how can one check quickly if the contents of a file has been modified without reading any of its contents?
stat command a recommended approach? I currently do
$ stat --format "%Y" hello.txt
and later I can check if the same command yields the same output. If it does, I conclude that hello.txt has not changed.
My feeling is that one wants to throw in more parameters to be even more sure. For example, would adding the file size, file name, etc, provide an even better "fingerprint" of the file?
On this topic, I recall that a TrueCrypt volume I once had was always ignored by my incremental backup program, possibly because TrueCrypt made sure to leave no meta data changes behind. I suppose it is indeed possible to change all the data returned by
stat, hence it cannot be guaranteed to pick up on every possible modification of the file?