O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

File Comparison

diff

Line-by-line comparison of two files or directories.

comm

Line-by-line comparison of two sorted files.

cmp

Byte-by-byte comparison of two files.

md5sum

Compute a checksum of the given files (MD5).

There are three ways to compare Linux files:

  • Line by line (diff, diff3, sdiff, comm), best suited to text files

  • Byte by byte (cmp), often used for binary files

  • By comparing checksums (md5sum, sum, cksum)

These programs are all text-based. For a graphical file-comparison tool, try xxdiff at http://furius.ca/xxdiff.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required