View Single Post
  #9   (View Single Post)  
Old 30th July 2009
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

Hm, I don't know what's wrong with suggestion jggimy made? Because the name doesn't come before the hash? Then just:
Code:
$ find . -type f -exec md5 {} + | awk '{ print $4, $2 }'
IMHO, path to file is usefull if you got several directories containing mp3's.
Also, using awk you could filter the duplicates, using something like this:
Code:
$ find . -type f -exec md5 {} + | awk -f find.awk


find.awk:

a[$4]++ { if(match($2, /[^\/]*\)/)) {
           pattern=substr($2, RSTART, RLENGTH-1);
               printf("%s\t%s\n", $4, pattern);
           }
}
I'm sorry for not providing more command output or examples, I'm doing this on a Windows machine.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD

Last edited by s0xxx; 30th July 2009 at 01:51 PM.
Reply With Quote