Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
service
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
7 user(s) are online (7 user(s) are browsing encyclopedia)

Members: 0
Guests: 7

more...
partner

Diff

In Computing, diff is a utility that outputs the differences between two text files. The program s output is also called a diff .

=Usage=

It is invoked from the command line with the names of two files: diff firstone.txt secondone.txt The result might look like this: 0a1,3 > This is an important notice! It should > therefore be located at the beginning of > this document! 7,12d9 < This paragraph contains text that is < outdated - it will be deprecated and < deleted in the near future. < This is an important notice! It should < therefore be located at the beginning of < this document! 14,15c11,14 < spell check this dokument. On the other < hand, I could do with some shoarma. --- > spell check this document. On the other > hand, I could do with some shoarma. > This paragraph contains important new > additions to this document. In this normal diff output , a stands for added , d for deleted and c for changed . By default, lines common to both files are not shown. Lines that have moved will show up as added on their new location and as deleted on their old location.

In unified format , each line that occurs only in the first file is preceded by a minus sign, each line that occurs only in the second file is preceded by a plus sign, and common lines are preceded by a space.

Lines beginning with three plus signs indicate the number of lines in each hunk , the file names, and where in the files to find them. Diff output is often used as input to the patch (Unix) program.

The first editions of the diff program were designed for line comparisons of text files expecting the newline character to delimit lines. By the 1980s, necessary support for binary files resulted in a shift in the application s design and implementation.

= History =

The diff program was developed in the early 1970s on the Unix operating system which was emerging from AT&T Bell Labs in Murray Hill, New Jersey. The final version, first shipped with the 5th Edition of Unix in 1974, was entirely written by Douglas McIlroy. This research was published in a 1976 paper co-written with James W. Hunt who developed an initial prototype of diff.

McIlroy s work was preceded and influenced by Stephen C. Johnson s comparison program on GECOS and Mike Lesk s proof program. Proof originated on Unix and produced line-by-line changes like diff and even used angle-brackets ( > and