Diff

diff
Original author(s)Douglas McIlroy
(AT&T Bell Laboratories)
Developer(s)Various open-source and commercial developers
Initial releaseJune 1974 (1974-06)
Written inC
Operating systemUnix, Unix-like, V, Plan 9, Inferno
PlatformCross-platform
TypeCommand
LicensePlan 9: MIT License

diff is a shell command that compares the content of files and reports differences. The term diff is also used to identify the output of the command and is used as a verb for running the command. To diff files, one runs diff to create a diff.[1]

Typically, the command is used to compare text files, but it does support comparing binary files. If one of the input files contains non-textual data, then the command defaults to brief-mode in which it reports only a summary indication of whether the files differ. With the --text option, it always reports line-based differences, but the output may be difficult to understand since binary data is generally not structured in lines like text is.[2]

Although the command is primarily used ad hoc to analyze changes between two files, a special use is for creating a patch file for use with the patch command – which was specifically designed to use a diff output report as a patch file. POSIX standardized the diff and patch commands including their shared file format.[3]

  1. ^ Eric S. Raymond (ed.), "diff" Archived 2014-01-31 at the Wayback Machine, The Jargon File, version 4.4.7
  2. ^ MacKenzie et al. "Binary Files and Forcing Text Comparison" in Comparing and Merging Files with GNU Diff and Patch. Downloaded 28 April 2007. [1] Archived 2017-12-19 at the Wayback Machine
  3. ^ IEEE Computer Society; The Open Group (26 September 2008). Standard for Information Technology—Portable Operating System Interface (POSIX) Base Specifications, Issue 7. pp. 2599–2607. IEEE Std. 1003.1-2001 specifies traditional, "ed script", and context diff output formats; IEEE Std. 1003.1-2008 added the (by then more common) unified format.

From Wikipedia, the free encyclopedia · View on Wikipedia

Developed by Nelliwinne