Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 1c1 in diff tool mean?

Tags:

linux

diff

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!

like image 500
Ra1nWarden Avatar asked Nov 28 '13 00:11

Ra1nWarden


People also ask

What does 1C1 mean?

stage 1C1 means the cancer is in one or both ovaries and the ovary ruptures (bursts) during surgery. stage 1C2 means the cancer is in one or both ovaries and the ovary ruptures (bursts) before surgery or there is some cancer on the surface of an ovary.

What is diff format?

Typically, diff is used to show the changes between two versions of the same file. Modern implementations also support binary files. The output is called a "diff", or a patch, since the output can be applied with the Unix program patch.

What does diff mean in coding?

Alternatively referred to as compare, diff is short for different or difference and describes a program's ability to show the difference between two or more files. A diff is an invaluable tool in programming as it enables a developer to see what has changed in-between versions.


1 Answers

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.

like image 196
Jim Lewis Avatar answered Oct 20 '22 21:10

Jim Lewis