Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Linux, if I have two directories, how I can see the differences of content in these directories?

Now I use this command:

diff <(ls -d dir1/*) <(ls -d dir2/*)

Any other idea?

share|improve this question

Why not use diff on the directories themselves?

$ tree
|-- test1
|   |-- bar
|   `-- foo
`-- test2
    |-- baz
    `-- foo

The result:

$ diff test1 test2
Only in test1: bar
Only in test2: baz
share|improve this answer
I recall the -r flag being required in some cases... – grawity May 29 '12 at 21:56
Not if you want to mimic what the OP did, but I'll leave reading the manpage to them. – slhck May 30 '12 at 6:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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