Just because we can't read the contents of a file doesn't mean we can't tell them apart. Find out how to compare binary files.
- [Instructor] Though we can't usually…make sense of differences in binary files ourselves…as we can when comparing text files line by line,…we can compare their type, their size,…and other secondary aspects of them.…We can even compare the contents.…Though at a byte for byte level…rather than reading differences in words.…Comparing binaries byte for byte…can be accomplished with the cmp command line tool…which will tell you where files differ.…Here we can compare our text files from earlier.…
But instead of interpreting them…as eight bit ASCI text,…we read them for their byte values directly.…Cmp without any other options,…tells us the location or address…of where the first difference in the files exists.…If they're identical, you'll just get no output.…Here I can see that these files…begin to differ at byte 27.…To see a list of all the locations…where the bytes differ,…You can use the -l option.…I'll write cmp -l…text1.txt…text2.txt.…
And here's a list of all of the different bytes.…Beginning at byte 27,…where in file one that byte's 61 in hexadecimal…
- Exploring filesystems
- Installing Linux on a physical or virtual machine
- Working with files, directories, and links
- Finding files
- Handling input/output redirection
- Comparing text files and non-text files
- Compressing and decompressing files
- Configuring file permissions
- Managing the root account
- Accessing the command line remotely
- Transferring files
Skill Level Beginner
1. Install and Log Into Ubuntu
System documentation11m 21s
2. Working with Files in the Terminal
3. Security and Administration
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.