Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 old similar directory trees with MP3 files in them. I am happily using tools like diff and Rsync to identify and merge the files that are only present on one side, or are identical, I'm left with a bunch of files that are bitwise different.

On running diff over a pair actually different files, (with -a tag to force text analysis) it produces incomprehensible gibberish. I have listened to files from both sides, and they both seem to play fine (but at nearly 10 minutes per song, when listening to them twice each, I haven't done many)

I suspect the differences are due to some player in the past "enhancing" my collection by messing about with ID3 tags, but I can't be certain. Even if I identify differences in ID3 tags, I would like to confirm that no cosmic ray or file copy error issues have damaged any of the files.

One method that occurs to be is finding the byte locations of the differences, and ignoring all changes in the first ~10kb of each file, but I don't know how to do this.

I have on the order of a hundred or so files that differ across the directory tree.

I found How to compare mp3, flac audio data in a file, ignoring header data (ID3 tag) etc.? -- but I can't run alldup due to being Linux only, and from the sounds of it, it would only partially solve my issues anyway.

share|improve this question

Beyond Compare according to topic?

Beyond Compare 3 does not run as a console application on Linux. It requires X-Windows.


Red Hat Enterprise Linux 4-6

Fedora 4-14

Novell Suse Linux Enterprise Desktop 10

openSUSE 10.3-11.2

Ubuntu 6.06-10.10

Debian 5.04

Mandriva 2010

share|improve this answer

Beyond Compare (referenced above) looks like a great solution. I've never used it. The bit about Xwindows just means that it wants to run in a gui, not straight command line. If you have a gui installed, then the chances that Xwindows is already properly installed on your system are extremely good.

Some ideas on how to proceed:

cmp -i 10kB file1 file2

will compare bytewise two arbitrary files on Linux, first skipping 10kb on each file. It even has an option for skipping different byte counts on each file. The -b parameter will print out differing bytes, but that might be a very long output, so if you use it, pipe the output into a file or into less. You'd have to decide how many bytes to skip. I don't know that answer. To use it effectively for multiple files, you'd have to write a script in bash or another language. Maybe running it as part of a find command with an exec option would work.

In the future, if looking for duplicate files, check out fdupes. It's a utility designed just for that. I used it when I was still figuring out how to manage photos on my computer and ended up with a bunch of directories with lots of duplicates in them.

Also, if you look up fdupes on wikipedia, there's a whole raft of Linux file compare programs listed in the entry.

Just for the heck of it, I had a look at:

which specifies the structure of id3 tags. It "recommends" that the tags be placed at the start of the file, but also provides for additional tags to be added at the end of the file, so unless nobody uses that option, there may be meta information elsewhere in the file, not just at the beginning. A cursory look at the spec reveals that id3 tag info is variable in length, so there would be no exact byte count that would be guaranteed to skip over it, but 10k as originally suggested ought to be way more than enough to skip the initial tags.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .