Linux Comm Cmp
# Linux cmp Command
[ Linux Command Manual](#)
The Linux `cmp` command is used to compare two files for differences.
When the two files being compared are exactly the same, the command does not display any information. If differences are found, it will by default mark the character and column number of the first difference. If no file names are specified or if the given file name is "-", the `cmp` command reads data from the standard input device.
### Syntax
cmp
**Parameters**:
* `-c` or `--print-chars`: In addition to marking the decimal code of the differing location, also display the corresponding character.
* `-i` or `--ignore-initial=`: Specify a number of characters to ignore.
* `-l` or `--verbose`: Mark all locations that differ.
* `-s` or `--quiet` or `--silent`: Do not display error messages.
* `-v` or `--version`: Display version information.
* `--help`: Online help.
### Example
To determine if two files are the same, enter:
cmp prog.o.bak prog.o
This compares `prog.o.bak` and `prog.o`. If the files are the same, no message is displayed. If the files are different, the first differing location is displayed; for example:
prog.o.bak prog.o differ: char 4, line 1
If the message `cmp: EOF on prog.o.bak` is displayed, it means the first part of `prog.o` is the same as `prog.o.bak`, but there is additional data in `prog.o`.
[ Linux Command Manual](#)
YouTip