美文网首页运维日常
判断两个文件是否相同

判断两个文件是否相同

作者: 大白菜的猪猪 | 来源:发表于2020-04-11 12:15 被阅读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

    相关文章

      网友评论

        本文标题:判断两个文件是否相同

        本文链接:https://www.haomeiwen.com/subject/zscymhtx.html