Correcting the file timestamp for JPG files using jhead

  • When I was migrating things around after dropping Windows for Korora 25, I accidentally missed a switch at some point and lost all the original timestamps on my files that I migrated.

    I do not care about most things, but for all my photos, I really miss having the file timestamps match the Exif data (aka the original timestamps).

    A quick google led me to a few options, but I chose jhead for its simplicity. There are some other options that are quite a bit more powerful. But I did not need those feature for this.

    Install jhead

    #fedora has in in the base repository
    dnf install -y jhead
    #centos needs the EPEL
    yum install -y epel-release
    yum install -y jhead

    Using it is extremely simple.
    Just change to the directory you want to fix and use the -ft switch (fix time)

    cd ~/Pictures
    jhead -ft

    Now if you are like me, you will have a bunch of sub folders and such. jhead does not do recursion, but this is easy enough with a find command.

    cd ~/Pictures
    find -iname '*.jp*g' -exec jhead -ft {} +

    The man page for jheadhas more details on what else it can do. But this was all I needed out of it, and it worked brilliantly.

    Website for jhead: