Comparing Directories (diff..?) with its File's Sizes, Ignoring Filenames?
Hello All,
I have 2 directories of mp3s, around about 200+ files or so, in which the mp3s ALL had weird
names after backing them up off my iPod. All the files were named in the format of ABCD.mp3...
I.e. four capital letters with .mp3
I created a Bash script which basically uses the id3tool command to rename the "actual" filenames
to the format of "Artist - Title.mp3". Now some of the files didn't have any information in the id3
tags so I just kept the names the same (i.e. ABCD.mp3). So when I run my script it doesn't do
anything with the original files but creates copies with the new names to a new directory.
Now when I do an "ls -l" on the old and new dirs, I get about a 15 file difference between the old
ones and the new ones. Is there a way to run a diff command (or something similar) and somehow use
awk or something like that to use the file size from "ls -l" command to compare that instead of the names.
I'm positive I could probably whip something up in Perl to do this, but I really want to try this
through the CLI first, because I know there is some powerful commands that can be run that could
take the place of an entire Perl script...
If anyone has any suggestions, or could point me on the right path, that would be great!
Thanks in Advance,
Matt
Last edited by mrm5102; 04-20-2012 at 01:25 PM.
|