Difference between two folders

Discussion in 'macOS' started by wrldwzrd89, Dec 27, 2008.

  1. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #1
    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.
     
  2. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #2
    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.
     
  3. wrldwzrd89 thread starter macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #3
    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!
     

Share This Page