I tried to use command
ls --time=atime
it was working in one directory but wasn't working in another directory.
I opened certain files in vim, evince and other applications but after the
command file access times weren't changed.
When I type touch file.txt
the access time is changed, but when I type vim file.txt
the access time is not changed.
What is wrong here?
Best Answer
With default mounts options, access times are handled in a special way on linux:
The
relatime
mount option was made the default option since linux kernel 2.6.30. That is the reason forls --time=atime
not listing what you expect.Solution: To use strict (legacy) behavior for atime use the
strictatime
mount option (e.g. in/etc/fstab
).Note: To completely disable atime updates, one can use
noatime
.