2014-02-02 12:26:10 +00:00
|
|
|
# diff
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Compare files and directories.
|
2014-02-02 12:26:10 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Compare files:
|
2014-02-02 12:26:10 +00:00
|
|
|
|
|
|
|
`diff {{file1}} {{file2}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Compare files, ignoring white spaces:
|
2014-02-02 12:26:10 +00:00
|
|
|
|
|
|
|
`diff -w {{file1}} {{file2}}`
|
|
|
|
|
2018-10-19 10:42:28 +01:00
|
|
|
- Compare files, showing the differences side by side:
|
2014-02-02 12:26:10 +00:00
|
|
|
|
|
|
|
`diff -y {{file1}} {{file2}}`
|
|
|
|
|
2018-10-19 10:42:28 +01:00
|
|
|
- Compare files, showing the differences in unified format (as used by `git diff`):
|
|
|
|
|
|
|
|
`diff -u {{file1}} {{file2}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Compare directories recursively:
|
2014-02-02 12:26:10 +00:00
|
|
|
|
|
|
|
`diff -r {{directory1}} {{directory2}}`
|
|
|
|
|
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
|
|
|
|
|
|
|
`diff -rq {{directory1}} {{directory2}}`
|