Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I think I have two directories with the same content, but I want to check it.

Also, I want to exclude a folder that is inside both directories.

How can I do it?

share|improve this question

command line:

diff --exclude=direxclude -r dir1 dir2

openSUSE 12.1: ok.

sttr@linux-sgfb:/tmp> md dir1
sttr@linux-sgfb:/tmp> md dir2
sttr@linux-sgfb:/tmp> cd dir2
sttr@linux-sgfb:/tmp/dir2> md 10
sttr@linux-sgfb:/tmp/dir2> md 11
sttr@linux-sgfb:/tmp/dir2> md 12
sttr@linux-sgfb:/tmp/dir2> md 14
sttr@linux-sgfb:/tmp/dir2> cd ..
sttr@linux-sgfb:/tmp> cd dir1
sttr@linux-sgfb:/tmp/dir1> md 15
sttr@linux-sgfb:/tmp/dir1> md 11
sttr@linux-sgfb:/tmp/dir1> md 12
sttr@linux-sgfb:/tmp/dir1> md 17
sttr@linux-sgfb:/tmp/dir1> cd ..
sttr@linux-sgfb:/tmp> diff --exclude="11" -r dir1 dir2
Only in dir2: 10
Only in dir2: 14
Only in dir1: 15
Only in dir1: 17
sttr@linux-sgfb:/tmp> diff --exclude=11 -r dir1 dir2
Only in dir2: 10
Only in dir2: 14
Only in dir1: 15
Only in dir1: 17
sttr@linux-sgfb:/tmp>

CentOS 6.3 64: ok.

[root@local tmp]# mkdir dir1
....

Ubuntu 12.04 TLS: ok.

Ubuntu 12.04 TLS

share|improve this answer
    
@STTR sorry but it didn't work – user35538 Feb 8 '13 at 16:51
    
@user35538 Could you please be more specific? What didn't work, what did you enter? – Daniel Beck Feb 8 '13 at 17:03
    
diff --exclude="direxclude" -r dir1 dir2 variant? – STTR Feb 8 '13 at 17:04
    
version OS test? – STTR Feb 8 '13 at 17:15
    
@STTR Ubuntu 12.04 – user35538 Feb 8 '13 at 17:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .