cmp
Quick Reference
Command Name:
cmp
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
File comparison
Compare two files byte by byte for differences
- 2
Data validation
Verify that files are identical or detect differences
- 3
Quality assurance
Ensure file integrity and consistency
- 4
Script automation
Automate file comparison in scripts and workflows
Syntax
cmp [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 cmp command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.