The Wayback Machine - https://web.archive.org/web/20221005133931/https://github.com/cheat/cheatsheets/blob/master/diff
Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
# 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>