user@mbp$ diff --suppress-common-lines -y file1.txt file2.txt

Some output

user@mbp$ echo $? 



I'm curious why it throws exit code 1 rather 0 if its giving me what I need?

I realize this is more of a shell in general question rather than ubuntu.

  • 1
    Exit status is 0 if inputs are the same, 1 if different, 2 if trouble. - from man diff – steeldriver Nov 25 '16 at 11:59

a quick reading of the diff man pages showed me that the exit codes are different than what I was thinking.

Exit code 1 = differences were found.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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