Author Topic: Lots of files --> "Argument list too long"  (Read 1504 times)


  • Newbie
  • *
  • Posts: 1
Lots of files --> "Argument list too long"
« on: August 17, 2016, 05:02:04 PM »
Hi - I'm new to exiftool but love it so far and have used it successfully.  I am currently faced with a rescue drive of  about 800,000 files.  When I try to use exiftool, even on a large subset of this, I receive the following error message:

sh: /usr/local/bin/exiftool: Argument list too long

Any ideas of how to override this?



Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 1140
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Lots of files --> "Argument list too long"
« Reply #1 on: August 17, 2016, 05:24:00 PM »
Looks like you provide the files individually to exiftool. Thoug the limit is high, there still is a limit to how many arguments you can pass this way. Why don't you use the -r option and just provide one or more directories? exiftool will then recurse into all directories it finds from there. If you want you can limit the file types by using e.g., -ext JPG.

Hope this helps,
Hayo Baan – Photography


  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3803
Re: Lots of files --> "Argument list too long"
« Reply #2 on: August 17, 2016, 05:39:39 PM »
It might also just be the limit of the number of characters in a command imposed by the OS.  Windows cmd is limited to just over 8k characters.  According to this stackoverflow answer, linux can be "anywhere from 131072 to 2621440".

Another alternative would be to save the full filepath/names list to a text file and then passing that to exiftool with -@ /path/to/filelist.txt
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.