verify.1s
Verify file integrity using signature files
SYNOPSIS
verify file1 file2
PARAMETERS
file1
The first file to compare.
file2
The second file to compare.
DESCRIPTION
The `verify` command compares two files byte-by-byte and reports the first byte where they differ. Unlike `cmp`, `verify` provides a more verbose output, including the offset (in decimal, octal, and hexadecimal), and the differing byte values in octal and character format. This makes it easier to pinpoint exactly where a difference occurs. It is particularly useful for verifying the integrity of files after transfers or modifications. The command is simple and focuses on reporting the *first* discrepancy found rather than exhaustively checking the entire file. `verify` is often implemented as a shell script using `cmp` and other tools, rather than as a compiled binary.
CAVEATS
The `verify` command typically only reports the *first* difference found. It does not continue scanning the file after identifying the first mismatch. If no differences are found, the exit code is 0; otherwise, the exit code is non-zero. Since it's often implemented as a shell script, its behavior and available options can vary across systems. Error messages may not be as descriptive as those from utilities like `cmp` or `diff`.
EXIT STATUS
The command returns 0 if the files are identical. If a difference is found, a non-zero exit status is returned.
TYPICAL OUTPUT
A typical output might look like:
verify: file1 and file2 differ: char 10 is 'A' 0101, should be 'B' 0102.
Where 10 represents the byte offset, 'A' is the character of the first file at that byte, '0101' the octal representation and 'B' and '0102' representing the second file data.
IMPLEMENTATION NOTES
Due to the lack of a standardized binary, the exact output format and behavior can vary depending on the specific shell script implementation used. It's good practice to check the `verify` script's source code on your system using `which verify` and then `cat $(which verify)` to understand its specific functionality.