How can I compare the directry lists inside directories?

266 Views Asked by At

I have 2 directories, A and B. In A, I have subdirectories 1, 2, 3, 4 while in B I have 1 and 3. How can I highlight 2 and 4 easily? The contents of the subdirectories are the same, respectively, so I just want to compare the names.

Mark -> Compare Directories only compare files, but not directories.

1

There are 1 best solutions below

0
On

I don't know whether you can use other tools, but there is another way to compare directories (unless you don't mind using a command line).

In macOS you can simply type this command in the terminal:

    $ diff A/ B/
    Common subdirectories: A/1 and B/1
    Only in A/: 2
    Common subdirectories: A/3 and B/3
    Only in A/: 4

or

$ diff -rq A B
Only in A/: 2
Only in A/: 4

-r recursively compares any subdirectories
-q shows only differences without any details

For Windows

  • preinstalled comp command. Here is the link
  • preinstalled fc command. Here is the link
  • also you can download gnuwin32 which provides diff command and you can use it in almost the same way as described above.

Hope it helps somehow.