2014-02-02 12:26:10 +00:00
|
|
|
# diff
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Compare files and directories.
|
7za, 7zr, aapt, ab, alacritty, atom, avrdude, chown, chroot, clear, cmake, compare, curl, dd, diff: add German translation (#5286)
2021-02-20 20:30:55 +00:00
|
|
|
> More information: <https://man7.org/linux/man-pages/man1/diff.1.html>.
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2019-05-09 17:16:35 +01:00
|
|
|
- Compare files (lists changes to turn `old_file` into `new_file`):
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2019-05-09 17:16:35 +01:00
|
|
|
`diff {{old_file}} {{new_file}}`
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Compare files, ignoring white spaces:
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2019-05-09 17:16:35 +01:00
|
|
|
`diff -w {{old_file}} {{new_file}}`
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2018-10-19 10:42:28 +01:00
|
|
|
- Compare files, showing the differences side by side:
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2019-05-09 17:16:35 +01:00
|
|
|
`diff -y {{old_file}} {{new_file}}`
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2018-10-19 10:42:28 +01:00
|
|
|
- Compare files, showing the differences in unified format (as used by `git diff`):
|
|
|
|
|
2019-05-09 17:16:35 +01:00
|
|
|
`diff -u {{old_file}} {{new_file}}`
|
2018-10-19 10:42:28 +01:00
|
|
|
|
2019-05-09 17:16:35 +01:00
|
|
|
- Compare directories recursively (shows names for differing files/directories as well as changes made to files):
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2019-05-09 17:16:35 +01:00
|
|
|
`diff -r {{old_directory}} {{new_directory}}`
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Compare directories, only showing the names of files that differ:
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2019-05-09 17:16:35 +01:00
|
|
|
`diff -rq {{old_directory}} {{new_directory}}`
|