Skip to content
Advertisement

bash / cmp: compare two consecutive jpg. files with same size of a long list

I’m trying to apply the cmp command to a number of consecutive jpg files with same size but different name, in order to make sure they are the indeed same. Since there are almost 4000 files, I would like to create a for loop through them with cmp and produce a final output with the list of actual same files, but so far I haven’t been able to.

This is a sample of the file list:

JavaScript

Advertisement

Answer

Unless this is a coding exercise (in which case my recommendation is not applicable), look into fdupes. It does exactly what you want.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement