Skip to main content
Add better directory structure diagram. Miner grammar tweaks.
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

show How does diff"diff --excludeexclude" work?

I'm trying to use diff to compare two directory trees while ignoring certain sub-directories, but I'm not able toI cannot get it to work. This is what my file structure looks like:

temp/
|-- d1/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt
|-- d2/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt
temp/
|-- d1/
|   |-- f1.txt
|   `-- ignoreme/
|       `-- f2.txt
`-- d2/
    |-- f1.txt
    `-- ignoreme/
        `-- f2.txt

I'm trying to get it to ignore anything under d1/ignoreme and d2/ignoreme, but it won't do it.

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/ d1 d2
Files d1/ignoreme/f2.txt and d2/ignoreme/f2.txt differ

I also tried

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* d1 d2

and

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* --exclude=/home/ubuntu/temp/d2/ignoreme/* d1 d2

... but I always get the same result. How

How do I get this to work?

show does diff --exclude work?

I'm trying to use diff to compare two directory trees while ignoring certain sub-directories, but I'm not able to get it to work. This is what my file structure looks like:

temp/
|-- d1/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt
|-- d2/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt

I'm trying to get it to ignore anything under d1/ignoreme and d2/ignoreme, but it won't do it.

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/ d1 d2
Files d1/ignoreme/f2.txt and d2/ignoreme/f2.txt differ

I also tried

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* d1 d2

and

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* --exclude=/home/ubuntu/temp/d2/ignoreme/* d1 d2

but I always get the same result. How do I get this to work?

How does "diff --exclude" work?

I'm trying to use diff to compare two directory trees while ignoring certain sub-directories, but I cannot get it to work. This is what my file structure looks like:

temp/
|-- d1/
|   |-- f1.txt
|   `-- ignoreme/
|       `-- f2.txt
`-- d2/
    |-- f1.txt
    `-- ignoreme/
        `-- f2.txt

I'm trying to get it to ignore anything under d1/ignoreme and d2/ignoreme, but it won't do it.

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/ d1 d2
Files d1/ignoreme/f2.txt and d2/ignoreme/f2.txt differ

I also tried

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* d1 d2

and

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* --exclude=/home/ubuntu/temp/d2/ignoreme/* d1 d2

... but I always get the same result.

How do I get this to work?

Tweeted twitter.com/StackUnix/status/1194087816516554752

I'm trying to use diff to compare two directory trees while ignoring certain sub-directories, but I'm not able to get it to work. This is what my file structuresstructure looks like:

temp/
|-- d1/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt
|-- d2/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt

I'm trying to get it to ignore anything under d1/ignoreme and d2/ignoreme, but it won't do it.

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/ d1 d2
Files d1/ignoreme/f2.txt and d2/ignoreme/f2.txt differ

I also tried

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* d1 d2

and

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* --exclude=/home/ubuntu/temp/d2/ignoreme/* d1 d2

but gotI always get the same resultsresult. How How do I get this to work?

I'm trying to use diff to compare two directory trees while ignoring certain sub-directories, but I'm not able to get it to work. This is what my file structures looks like:

temp/
|-- d1/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt
|-- d2/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt

I'm trying to get it to ignore anything under d1/ignoreme and d2/ignoreme, but it won't do it.

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/ d1 d2
Files d1/ignoreme/f2.txt and d2/ignoreme/f2.txt differ

I also tried

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* d1 d2

and

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* -exclude=/home/ubuntu/temp/d2/ignoreme/* d1 d2

but got the same results. How do I get this to work?

I'm trying to use diff to compare two directory trees while ignoring certain sub-directories, but I'm not able to get it to work. This is what my file structure looks like:

temp/
|-- d1/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt
|-- d2/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt

I'm trying to get it to ignore anything under d1/ignoreme and d2/ignoreme, but it won't do it.

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/ d1 d2
Files d1/ignoreme/f2.txt and d2/ignoreme/f2.txt differ

I also tried

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* d1 d2

and

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* --exclude=/home/ubuntu/temp/d2/ignoreme/* d1 d2

but I always get the same result. How do I get this to work?

Source Link
d512
  • 751
  • 1
  • 5
  • 6

show does diff --exclude work?

I'm trying to use diff to compare two directory trees while ignoring certain sub-directories, but I'm not able to get it to work. This is what my file structures looks like:

temp/
|-- d1/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt
|-- d2/
    |-- f1.txt
    |-- ignoreme/
        |-- f2.txt

I'm trying to get it to ignore anything under d1/ignoreme and d2/ignoreme, but it won't do it.

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/ d1 d2
Files d1/ignoreme/f2.txt and d2/ignoreme/f2.txt differ

I also tried

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* d1 d2

and

diff -qr --exclude=/home/ubuntu/temp/d1/ignoreme/* -exclude=/home/ubuntu/temp/d2/ignoreme/* d1 d2

but got the same results. How do I get this to work?