# this will print if they're identical or not diff file1 file2 -s
if diff -u "$file1" "$file2"; then echo "$file1 and $file2 have identical contents" else : # the differences between the files have been listed fi