When searching for similar images using the command

findimagedupes -t 85 Папка_1 Папка_2 

error pops up:

findimagedupes: Argument list too long

How to solve this problem?

  • Compare files not all at once but in chunks. Get a list of all files, break it into 3 parts, run through findimagedupes 1 and 2, 1 and 3, 2 and 3 parts of the list, with an increase in the number of files to increase the number of parts. I can't help with the team. - Marsel Arduanov
  • one
    I have never used it, but judging by the line If a file "-" is given, a list of files is read from stdin. in manpages.ubuntu.com/manpages/natty/man1/findimagedupes.1p.html you can try ls -d Папка_1/* Папка_2/* | findimagedupes -t 85 - ls -d Папка_1/* Папка_2/* | findimagedupes -t 85 - (- instead of a list of files, means that file names must be taken from stdin) - avp

1 answer 1

according to the man findimagedupes , the program is able to maintain a database with the fingerprints of images (and, of course, the names of the files in which the images are stored).

You can specify a database file using the -f файл option. if it does not exist, it will be created. for general information: the database is in berkeley db format.

if a database is specified, a duplicate search will also be performed in it, and the signatures of all the files passed by the arguments (more precisely, the images stored in these files) will be added to the database.

several databases can be merged into one (in this case, the -f файл option can be used repeatedly) with the -M файл option:

 $ findimagedupes -n -M /путь/к/объединённой.бд -f /путь/к/первой.бд -f /путь/ко/второй.бд 

There are some more options for database manipulations. see the man page.


actually about the problem:

  1. files (with fingerprints) can be added to the database sequentially:

     $ findimagedupes -f /путь/к/бд -R -n /путь/к/первому/каталогу $ findimagedupes -f /путь/к/бд -R -n /путь/ко/второму/каталогу ... $ findimagedupes -f /путь/к/бд 

    option -n - do not search for duplicates (only counting prints and saving to database), option -R - view directories recursively.

  2. if there are a lot of files in one directory and this error occurs, you can select files in “batches”: /путь/к/[af]* - files starting with a, b, … f .
  3. if the previous version is not suitable, you can call the program using the find + xargs combination. This bundle will substitute the maximum possible number of files, launching the required program several times (if required):

     $ find /путь/к/каталогу -type f | xargs findimagedupes -f /путь/к/бд