Introduction
In this lab, you will learn how to use the cmp
command in Linux to compare the contents of two files, both text and binary. The cmp
command compares two files byte-by-byte and reports the first location where the files differ. You will create sample text and binary files, then use the cmp
command to compare them and explore its various options to customize the comparison.
The lab covers the following steps:
- Understand the
cmp
command and its basic usage. - Compare the contents of two text files using the
cmp
command. - Compare the contents of two binary files using the
cmp
command.