linuxdiff

What does 1c1 in diff tool mean?


I ran diff with two files and got the following output:

1c1
< dbacaad
---
> dbacaad

What does this mean? My two files seem to be exactly the same. Thank you very much!


Solution

  • To answer the question you raised in the title: 1c1 indicates that line 1 in the first file was c hanged somehow to produce line 1 in the second file.

    In practical terms: They probably differ in whitespace (perhaps trailing spaces, or Unix versus Windows line endings?).

    Try diff -w file1 file2, which will ignore whitespace. Or cmp file1 file2, which will tell you how many bytes into the file the first difference occurs.