13

Does there exist a tool that compare Directory tree (Files. sub dirs) and show you waht is missing. I have an upload too which I'm coding and would like to see if it does not mess with structure.

Nothing big just show me how does directory X compare with Y

To clarify more here is an example

The tree

Dir1+
     +Subdir1
     +sudir2
        +File1
        +File2

and the tree

Dir1+
     +Subdir1
     +sudir2
        +File1
        +File2

are the same but tree

Dir1+
     +Subdir1
     +sudir2
        +File1
        +File2

and tree

Dir1+
     +Subdir1
     +sudir2
        +File1
        +File3

Should show me that File2 is missing and File3 is added.

Does such a tool exists?

5

A less technical approach would be to use gui synchronization software such as FreeFileSync (Visual folder comparison and synchronization)

There is a ppa at launchpad:

Put these lines in a terminal:

sudo add-apt-repository ppa:freefilesync/ffs
sudo apt-get update
sudo apt-get install freefilesync

I've successfully been using this tool for a few years now to back-up and/or sync folders on Windows and Ubuntu.

See this screenshot I set-up displaying what it would do in your situation:

enter image description here

0
12

Meld is a very good graphical diff tool (and more):

meld dir1 dir2 &

enter image description here

3
  • I will give it a try. Hope it does all I have posted above! – Stefano Mtangoo Jun 19 '13 at 11:21
  • @StefanoMtangoo yes it does and it is a part of the standard repository so can be installed just like sudo apt install meld – jave.web Feb 2 at 17:04
  • be aware of RAM though, for comparing 2 bigger directory trees (around 10000 files vs 6000files) (real user data, nothing funky), it ate almost 20GBs of RAM x) – jave.web Feb 2 at 19:33
9

diff can compare directory trees, too.

diff <dir1> <dir2>

Or if you don't want to see the files content differences:

diff -q <dir1> <dir2>

Some graphical tools available in Ubuntu repos: dirdiff, fldiff, kdiff3, meld, mgdiff.

2
  • 4
    For a tree comparison, you need to go recursive. You need the -r option or it will be wrong. Could be a disaster too. – H2ONaCl Dec 29 '15 at 20:40
  • It has nice readable params diff --brief --recursive dir/one dir/two too if you like to understand what you are doing, brief: "report only when files differ" – jave.web Feb 2 at 17:09

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.