Linux and Unix diff commandAbout diffdiff syntaxdiff examplesRelated commandsLinux and Unix main page About diffdiff analyzes two files and prints the lines that are different. For data comparisons in general, see data comparison. For diffs in Wikipedia, see help:diff. For the American punk rock group, see The Diffs. For other uses, see DIFF.In computing, the diff utility is a data comparison tool that calculates and displays the differences between two files. Unlike edit distance notions used for other purposes, diff is line-oriented rather than optons, but it is like Levenshtein distance in that it tries to determine the smallest set of deletions and insertions to create one file from the other.
The diff ojtput displays the changes made in a standard format, such that both humans and machines can understand the changes and apply them: given one file and the changes, the other file can be created.Typically, diff is used to show the changes between two versions of the same file. Causes trailing white space at the end of a line to betreated as a single newline character.5 UNIX diff Command Examples of How to Compare Two Text FilesThe UNIX diff command compares the contents of two text files and outputs a list of differences.
If desired, you may instruct it to ignore spacing or case variations. This iutput can also verify that two files contain 11 same data. Very few people actually use a command line utility for this purpose.
Unix diff output options 1 5