Results 1 to 3 of 3
Hi
A long time ago I came here with a query about comparing directory structures so that I could ensure I had 2 copies of all of my mp3's - ...
- 06-17-2010 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 93
Command to compare directorys
Hi
A long time ago I came here with a query about comparing directory structures so that I could ensure I had 2 copies of all of my mp3's - 1 in high quality and 1 in portable quality. The original thread is here http://www.linuxforums.org/forum/lin...tructures.html
Now time has moved on I have begun to encode to flac, and I want to find and delete any mp3's that I now have as flac. The problem is, the file names are not always identical AND the extensions are different, meaning the command in the previous thread doesn't get me very far. The music is stored in the format of /home/music/mp3/Artist/Album/ and /home/music/flac/Artist/Album/ if I could just get a list of all the "album" subfolders which are duplicated I could work the rest by hand, any help will be appreciated, this is a big job!
Thanks
Jonny
- 06-19-2010 #2
You can use wild cards with grep. See man grep from command line. grep is extremely powerful.
- 06-22-2010 #3Just Joined!
- Join Date
- Mar 2007
- Posts
- 93
I have made some progress with this,
This outputs almost what I want, listing common sub-dirs but the problem is if both /flac/ and /mp3/ contain the same artist but not album then they still come out as common.Code:diff /home/music/collection/mp3/ /home/music/collection/flac/ -q | grep -i common
I've been suggested
so far I can't get those to work, putting them here for future reference and perhaps somebody has an idea how to make one of them workCode:diff folder_a/[^.]* folder_b/[^.]* -R diff <(find /path1 -maxdepth 1 -type f|sort) <(find /path2 -maxdepth 1 -type f|sort) diff <(ls -l /path1 |awk ' $1!~/^d/ {print $NF}' |sort) <(ls -l /path2 |awk ' $1!~/^d/ {print $NF}' |sort)


Reply With Quote