-
Notifications
You must be signed in to change notification settings - Fork 326
/
cmp
20 lines (15 loc) · 649 Bytes
/
cmp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
syntax: bash
---
# To output the byte and line number of the first difference found between two files:
cmp <path/to/file_1> <path/to/file_2>
# To output the first differing char between two files:
cmp -b <path/to/file_1> <path/to/file_2>
# To output every difference between two files:
cmp -b --verbose <path/to/file_1> <path/to/file_2>
# To compare two files starting after the first 100 bytes:
cmp -i 100 <path/to/file_1> <path/to/file_2>
# To limit to 200 the number of bytes to compare:
cmp -n 200 <path/to/file_1> <path/to/file_2>
# To compare two files with no output - only exit status:
cmp --quiet <path/to/file_1> <path/to/file_2>