forked from cheat/cheatsheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
diff
26 lines (18 loc) · 646 Bytes
/
diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# To view the differences between two files:
diff -u <file-1> <file-2>
# To view the differences between two directories:
diff -ur <dir-1> <dir-2>
# To ignore whitespace:
diff -ub <file-1> <file-2>
# To ignore blank lines:
diff -uB <file-1> <file-2>
# To ignore the differences between uppercase and lowercase:
diff -ui <file-1> <file-2>
# To report whether the files differ:
diff -q <file-1> <file-2>
# To report whether the files are identical:
diff -s <file-1> <file-2>
# To diff the output of two commands or scripts:
diff <(command1) <(command2)
# To generate a patch file from two files:
diff -Naur <file-1> <file-2> > <patch-file>