Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.