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.

  • see also on StackOverflow and also on SuperUser – αғ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 dto 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 0:06

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.

  • 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. 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

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

  • 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 – 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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.