i cant change the access time of any file i create. i tried the touch -a, touch -ad, touch -t commands, but the access time in the stat utility stays the same. Can you please help me to modify the access time of the file, and the change time [if possible]. Thank You.

  • 1
    Sometimes changes to the filesystem are not written to physical media immediately. Try forcing the update by issuing sync through the terminal before using stat – hmayag May 28 '14 at 6:48
  • 1
    What is the file you are trying to change, what is the location? – jobin May 28 '14 at 6:49
  • 1
    To increase performance, atime is often disabled, check grep atime /etc/fstab. touch changes mtime, so it should work, what exact command are you running? – bain May 28 '14 at 12:04
  • What is the underlying FS ? Are you using any lvm / fs snapshots ? – askb May 29 '14 at 4:08
  • @hmayag Buffering on top of the physical media is irrelevant here: the kernel still sees changes in the cache even if they haven't been written to disk. – poolie Jun 2 '14 at 4:17

Ubuntu, depending when/how you installed it, uses relatime or noatime mount options by default - this means that tracking of access times is basically disabled.

You can change it by removing that option from /etc/fstab and rebooting. Or, for instance

sudo mount -o remount,atime /home

on the relevant filesystem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.