Вы можете сами определить функцию для проверки файла по одному.
checkDiff() {
file1=$1
file2=$2
result=$3
rm -rf $result
#check Which one is big based line count
file1Count=$(cat ${file1} | wc -l)
file2Count=$(cat ${file2} | wc -l)
# to check which one need to pass to while loop
if [ $file1Count -gt $file2Count ] ; then
bigFile=$file1
smallFile=$file2
else
bigFile=$file2
smallFile=$file1
fi
#check difference line by line
cat $bigFile | while read line ; do
notpint=$(cat $smallFile | grep "$line")
if [ $? -ne 0 ]; then # if you want to print where they match change "ne" to "eq"
echo $line >> $result
fi
done
}
#
checkDiff <file1> <file2> <result filename>