English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
La commande cmp de Linux est utilisée pour comparer les différences entre deux fichiers.
If the two files compared are exactly the same, the command will not display any information. If there are differences, the default is to indicate the character and line number of the first difference. If no file name is specified or the specified file name is "-If " is specified, the cmp command will read data from the standard input device.
cmp [-clsv][-i <number of characters>][--help][first file][second file]
parameter:
To determine whether 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 different position 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, the first part of prog.o is the same as prog.o.bak, but there is other data in prog.o.