"diff" terabyte files
You can use bdiff
. It is used to compare files that are too large to be loaded in memory.
NAME
bdiff - big diff
SYNOPSIS
bdiff filename1 filename2 [n] [-s]
DESCRIPTION
bdiff is used in a manner analogous to diff to find which
lines in filename1 and filename2 must be changed to bring
the files into agreement. Its purpose is to allow processing
of files too large for diff. If filename1 (filename2) is -,
the standard input is read.