Skip to content

Instantly share code, notes, and snippets.

@dungmanh88
Created September 26, 2016 03:08
Show Gist options
  • Save dungmanh88/5b374965ad6fe73f9f33081dcceedc3d to your computer and use it in GitHub Desktop.
Save dungmanh88/5b374965ad6fe73f9f33081dcceedc3d to your computer and use it in GitHub Desktop.
Compare two files
diff <file1> <file2>
or
sum1=`md5sum <file1> | cut -d " " -f 1`
sum2=`md5sum <file2> | cut -d " " -f 1`
[ "$sum1" == "$sum2" ] && echo "equal" || echo "not equal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment