Diff
lastmod 2026-03-15created 2014-09-2913 edits
In computing, diff is a file comparison utility that outputs information about the differences between two files. It is generally used to show the changes between one version of a file and another version of the same file. diff shows changes between lines of document files. A file created with this command can be used with the patch command, a Unix-family program, to produce output.
Options
-
-u - Output in Unified Format.
-
-r - Search subdirectories recursively as well.
-
-N - Include new files in the Diff as well.
Example
Output the changes between two folders as a diff file in Unified Format.
Compare two directories.
Binary diff
Binary comparison: (used together with xxd)
You can also use colordiff:
Text Processing Commands
|
See also
- odiff
- imgdiff
- fclones - Efficient duplicate file finder
- DiffX – Next-generation extensible Diff format
- BlazeDiff - Ultra-fast image comparison library
- 0github - Heatmap-based Diff viewer for code review
- deff - Interactive git diff TUI viewer
- diffnav - GitHub-style Git diff pager