icyflame / oneliners

Bash one-liners that are always useful :heart:
MIT License
9 stars 0 forks source link

Oneliner to check if two files have the same SHA256 hash #1

Open icyflame opened 7 years ago

icyflame commented 7 years ago
$ sha256sum test_file | cut -d ' ' -f 1
$ identical test_file test_file_1
# should return true or return false depending on whether the files have the same hash
icyflame commented 6 years ago
if [ "`sha256sum data.json | cut -d ' ' -f 1`" == "`sha256sum readme.md | cut -d ' ' -f 1`" ]; then
echo "files are same"
else
echo "files are not same"