LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   organizing music (https://www.linuxquestions.org/questions/linux-software-2/organizing-music-505068/)

edgjerp 11-26-2006 04:39 PM

organizing music
 
I have quite a few mp3s sorted in folders by artist. some of them are probably marked wrong, and there are likely several doubles. what is the best way to find which files are identical regardless of name? some form of hash list probably, but the directories make it more difficult. Even when outputting md5deep to a file, I do not quite know what to do, what syntax do I use to search for any identical strings? (compare all to all)

It would also be nice to have a second directory tree, sorted by title instead of artist, (preferably just symlinked). Anyone know how to do this quickly? One file at a time is not really an option.

matthewg42 11-26-2006 04:56 PM

I'd execute mp5sum on the files, and then use uniq to find those checksums which appear more than once, and grep for them in the original list to show which files those checksums are for. You could do that with a script like this:
Code:

#!/bin/bash

tmp=$(mktemp)
cd /path/to/your/files
find . -type f -print0 |xargs -0 md5sum > "$tmp"
cut -d" " -f1 "$tmp" |sort |uniq -d |while read dupsum; do
    fgrep $dupsum "$tmp"
    echo ""
done
rm -f "$tmp"


edgjerp 11-26-2006 05:06 PM

Thanks, that solves that problem.

Is it possible to make another directory tree sorted by title from the one sorted by artist? (one built with symlinks)

matthewg42 11-27-2006 08:43 AM

If the mp3 files have ID3 tags in them with the artist, album etc, you could try tagtool, which I think can do that sort of thing (the tab with the cogs on).

Weirdly this exact topic was discussed on the Lotta Linux Links Podcast this week (show dated Thu, 23 Nov 2006) :D Dave (the guy who does the podcast) settled on a python program someone posted to him. You might try looking on his site for this, or if you can't find it there, contact him to see if you can get a hold of it.


All times are GMT -5. The time now is 04:06 PM.