Is there a way to extract EXIF information of all images within a directory (into an output file)? Preferably I also need GPS data but this is not essential.

I only ask, as I have a number of directories with a large number of image files within, so automating the EXIF extraction would be useful.

  • 1
    Do you need something more elaborate than for example for file in *.jpg; do echo "=== ${file} ===" >> outputfile; exiv2 "${file}" >> outputfile; done? Or find . -type f -name '*.jpg' -exec exiv2 '{}' ';' > outputfile (though that, as is, might not include the image file names; it should be easy to adapt, though)? – a CVn Dec 3 '13 at 10:27
  • I'll give this a go, will modify it to include file names. Thanks for the response! – davidbain Dec 3 '13 at 10:53

With exiftool:

exiftool -r . > exif.txt

(remove the -r if you didn't intend to recurse into sub-directories).

Note that GPS data usually is in EXIF tags.


You can use jhead to do this.

You can do a loop to parse each file, then grep the pattern you need.

  • Thanks for the quick response. Great idea, will give that a go. – davidbain Dec 3 '13 at 10:52

Along the same lines as exiftool there's also exiv2. Works similarly from the command line.

$ exiv2 *.jpg > exifs.txt

It lacks a recursive switch so you'd need to use a find command to walk it through a directory tree of image files.

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.