4

I found this question already, which has a lot of good answers, but as far as I can tell none of the programs listed compare only the filenames. What program can I use to compare two directories and list which files only exist in one or other directory?

I would strongly prefer a GUI, but I'm quite capable of using command line if I must.

Additional Info

I have a lot of files (in the range of 125,000+ per directory), so the tool MUST NOT compare the contents of the files, only the filenames, or it'll take forever.

Clonkex
  • 1,584
  • 2
  • 16
  • 18
  • see also on [StackOverflow](http://stackoverflow.com/questions/6217628/diff-to-output-only-the-file-names) and also [on SuperUser](http://superuser.com/questions/166317/linux-compare-directory-structure-without-comparing-files) – αғsнιη Oct 14 '14 at 12:39
  • @KasiyA The SO link: `diff` always checks inside files, even with the `-q` switch. The SU link: Yes, I found that and tried it as per my comment on my accepted answer :) – Clonkex Oct 14 '14 at 12:47
  • I tested them both of them are correct but in SU you need to change `d`to `f` ;) – αғsнιη Oct 14 '14 at 13:12
  • @KasiyA Yup, that or remove the `type` switch altogether (which is what I did). – Clonkex Oct 15 '14 at 00:06

3 Answers3

4

I would use a simple method, install the tree command:

sudo apt-get install tree

Run the following commands in a terminal:

tree folderA > folderA.txt
tree folderB > folderB.txt

Then use a GUI diff tool such as meld to compare both listings.

Sylvain Pineau
  • 61,564
  • 18
  • 149
  • 183
  • 1
    Good suggestion, thanks. I'm currently running through another potential solution I found that may or may not work - if it doesn't, I'll try your method. I'll answer my own question if my current method works satisfactorily. – Clonkex Oct 14 '14 at 11:29
  • I tried [this method](http://superuser.com/a/166322). It worked, but produced a less-than-ideal output. Then I tried your method. A+ works perfectly! Thankyou! – Clonkex Oct 14 '14 at 11:43
0

You can try dupeGuru

dupeGuru is a tool to find duplicate files on your computer. It can scan either filenames or contents. The filename scan features a fuzzy matching algorithm that can find duplicate filenames even when they are not exactly the same.dupeGuru

Mitch
  • 106,657
  • 24
  • 210
  • 268
  • Can it list the opposite? That is, can it list files that are *not* the same? I don't want to know which files are the same, rather which are different. – Clonkex Oct 14 '14 at 11:25
  • 1
    I don't think that it will do that. For that you may want to take a look at [filecmp](https://docs.python.org/2/library/filecmp.html) – Mitch Oct 14 '14 at 11:34
  • Thanks, I'll bear that in mind, but I'd prefer not to have to write a Python script. – Clonkex Oct 14 '14 at 11:39
0

Gnome Commander has a built-in feature of Compare Directories (shortcut Shift+F2).

The different files are marked after comparison (red in the screenshot).

See screenshot: enter image description here

XoXo
  • 101
  • 3