Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wrldwzrd89

macrumors G5
Original poster
Jun 6, 2003
12,110
77
Solon, OH
Is there a simple way (i.e. 100% free, including using the Terminal) to determine which files in one folder are NOT in another, disregarding any extensions the files in each folder have?

One way I thought I could approach this, using the Terminal:
Code:
ls /path/to/first/folder > folder1.txt
ls /path/to/second/folder > folder2.txt
diff folder1.txt folder2.txt

Only problem is that this does NOT ignore extensions, so all the lines in both text files will be reported as different. This is NOT what I want.
 
So, for instance, if you have a hayguys.jpg in one folder and a hayguys.gif in the other folder, you want them to be recognized as the same file, correct?

I'm a grep novice, but is there a way you can use grep and/or regex to do it? I know I've seen scripts that strip file extensions before, like this discussion here:

http://www.google.com/search?q=use+...s=org.mozilla:en-US:official&client=firefox-a

It should not be too hard to modify them for your purpose.
 
So, for instance, if you have a hayguys.jpg in one folder and a hayguys.gif in the other folder, you want them to be recognized as the same file, correct?

I'm a grep novice, but is there a way you can use grep and/or regex to do it? I know I've seen scripts that strip file extensions before, like this discussion here:

http://www.google.com/search?q=use+...s=org.mozilla:en-US:official&client=firefox-a

It should not be too hard to modify them for your purpose.
Yes, exactly. This is because I'm mass-converting files from one format to another, and I want to find the files that didn't convert properly. Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.