Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Touch files to change modification time relative to original modification time

If you are trying to correct an offset your digital camera has, or perhaps the filesystem has, you can fix it per file!

for word in *.jpg ;
do
   echo "${word}" ; touch -r "${word}" -d "+5 hours" "${word}"
done

References

Weblinks

  1. Ripped off from https://superuser.com/questions/122863/linux-shell-change-a-files-modify-timestamp-relatively/122896#122896

Internet search

linux change modify time relative to modify time

Comments