运维日常

判断两个文件是否相同

2020-04-11  本文已影响0人  大白菜的猪猪

#/bin/bash

file1=/mnt/mmc/test/aa

file2=/mnt/mmc/test/bb

diff $file1 $file2 > /dev/null

if [ $? == 0 ]; then

echo "Both file are same"

else

echo "Both file are different"

fi

上一篇下一篇

猜你喜欢

热点阅读