How do use cmp command to compare byte by byte on linux?
-
Also see: How do i use comm to compare two sorted files in linux?
Sample files are:
$ cat fileA Flying by the seat of my pants. Surfing by the seat of my pants. Rowing by the seat of my pants.
$ cat fileB Flying by the seat of my pants. Surfing by the seat of my pants. Swimming by the seat of my pants.
Shows the first byte difference.
$ cmp fileA fileB fileA fileB differ: byte 66, line 3
There's no output if all the bytes are the same.
© Lightnetics 2024