FG
💻 Software

Listing lines from just one file in DIFF

Fresh5 days ago
Mar 15, 202638007 views
Confidence Score0%
0%

Problem

I would like to get (GNU)DIFF to printout only lines that are different in one file. So given i would like to produce The following looks as though it should be helpful but it is a bit cryptic :

Error Output

==> diffa.txt <==
    line1
    line2 - in a only
    line3
    line4 changed
    line5

    ==> diffb.txt <==
    line1
    line3
    line4 changed …

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Listing lines from just one file in DIFF

Low Risk

Not sure alone can do it but you can always use the power of other GNU utilities to help you. It does the diff, then selects only the lines that begins with '-' - those are changed and have values from diffa.txt file, then just remove those '-' sign…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment