1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/diff.md

28 lines
550 B
Markdown
Raw Normal View History

2014-02-02 13:26:10 +01:00
# diff
> Compare files and directories.
2014-02-02 13:26:10 +01:00
- Compare files:
2014-02-02 13:26:10 +01:00
`diff {{file1}} {{file2}}`
- Compare files, ignoring white spaces:
2014-02-02 13:26:10 +01:00
`diff -w {{file1}} {{file2}}`
- Compare files, showing the differences side by side:
2014-02-02 13:26:10 +01:00
`diff -y {{file1}} {{file2}}`
- Compare files, showing the differences in unified format (as used by `git diff`):
`diff -u {{file1}} {{file2}}`
- Compare directories recursively:
2014-02-02 13:26:10 +01:00
`diff -r {{directory1}} {{directory2}}`
- Compare directories, only showing the names of files that differ:
2014-02-02 13:26:10 +01:00
`diff -rq {{directory1}} {{directory2}}`