Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Diff
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Standard UNIX utility for file comparison}} {{About|the utility program|the general topic of file comparison|File comparison|diffs in Wikipedia|:Help:Diff|other uses|DIFF (disambiguation){{!}}DIFF}} {{Lowercase title|title=diff}} {{Infobox software | name = diff | title = diff | screenshot = <!-- Image name is enough --> | caption = | screenshot size = | screenshot alt = | collapsible = | author = [[Douglas McIlroy]]<br />([[AT&T Bell Laboratories]]) | developer = Various [[open-source software|open-source]] and [[commercial software|commercial]] developers | released = {{Start date and age|1974|6}} | latest release version = | latest release date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --> | programming language = [[C (programming language)|C]] | operating system = [[Unix]], [[Unix-like]], [[V (operating system)|V]], [[Plan 9 from Bell Labs|Plan 9]], [[Inferno (operating system)|Inferno]] | platform = [[Cross-platform]] | genre = [[Command (computing)|Command]] | license = Plan 9: [[MIT License]] | website = | standard = | AsOf = }} In [[computing]], the utility '''diff''' is a [[data comparison]] tool that computes and displays the differences between the contents of files. Unlike [[edit distance]] notions used for other purposes, diff is line-oriented rather than character-oriented, 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 utility displays the changes in one of several standard formats, such that both humans or computers can parse the changes, and use them for [[patch (Unix)|patching]]. Typically, ''diff'' is used to show the changes between two versions of the same file. Modern implementations also support [[binary file]]s.<ref>MacKenzie ''et al.'' "Binary Files and Forcing Text Comparison" in ''Comparing and Merging Files with GNU Diff and Patch''. Downloaded 28 April 2007. [https://www.gnu.org/software/diffutils/manual/html_node/Binary.html] {{Webarchive|url=https://web.archive.org/web/20171219223414/http://www.gnu.org/software/diffutils/manual/html_node/Binary.html|date=2017-12-19}}</ref> The output is called a "diff", or a [[patch (computing)|patch]], since the output can be applied with the [[Unix]] program [[patch (Unix)|{{Mono|patch}}]]. The output of similar file comparison utilities is also called a "diff"; like the use of the word "[[grep]]" for describing the act of searching, the word ''diff'' became a generic term for calculating data difference and the results thereof.<ref>Eric S. Raymond (ed.), [http://catb.org/jargon/html/D/diff.html "diff"] {{Webarchive|url=https://web.archive.org/web/20140131071625/http://www.catb.org/jargon/html/D/diff.html |date=2014-01-31 }}, ''The Jargon File'', version 4.4.7</ref> The [[POSIX]] standard specifies the behavior of the "diff" and "patch" utilities and their file formats.<ref>{{cite book|author1 = IEEE Computer Society|author2-link = The Open Group|author2 = The Open Group|date=26 September 2008|title = Standard for Information Technology—Portable Operating System Interface (POSIX) Base Specifications, Issue 7|pages = 2599β2607|author1-link = IEEE Computer Society}} 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.</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)