diff
Quick Reference
Command Name:
diff
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
File comparison
Compare two files line by line to identify differences
- 2
Code review
Review changes made to source code files
- 3
Configuration management
Track changes to configuration files between versions
- 4
Patch creation
Generate patch files that can be applied to update files
Syntax
diff [OPTION]... [FILE]...
Options
| Option | Description |
|---|---|
-l |
Use a long listing format |
-a |
Show hidden entries starting with . |
-h |
Human-readable sizes |
-R |
List subdirectories recursively |
Examples
How to Use These Examples
The examples below show common ways to use the diff command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.