DIFF Commands Cheat Sheet

Here is a cli commands cheat sheet for DIFF command, you can use this as a quick reminder for basic commands with a brief description for each of the commands.

What is DIFF command?

Add some data here

        # To view the differences between two files:
diff -u  

# To view the differences between two directories:
diff -ur  

# To ignore whitespace:
diff -ub  

# To ignore blank lines:
diff -uB  

# To ignore the differences between uppercase and lowercase:
diff -ui  

# To report whether the files differ:
diff -q  

# To report whether the files are identical:
diff -s  

# To diff the output of two commands or scripts:
diff <(command1) <(command2)

# To generate a patch file from two files:
diff -Naur   > 
    

Check out the DIFF command documentation .


You can also check our MegaSh cheatsheet tool, that has 150+ searchable linux cheat sheets in one page, so you never forget a command as you work again

Check Also

Best AI tools list