Suppose I have two files, A and B, and that lengthOf(A) < lengthOf(B). Is there a unix utility to tell if file B duplicates file A for the first lengthOf(A) bytes?
If I do "diff A B", the output will be all the 'extra stuff' in the B file, which misses the point; I don't care what else might be in file B.
If I do "comm A B", then I have to visually inspect that nothing turns up in the column for 'only in A'. This can be difficult when lengthOf(B) >> lengthOf(A), though I suppose it could be tamed with grep.