Home · Latest · Trends  /  general
0

Compare remote file with local file using md5sum

rated 0 times [  0] [ 0]  / comments: 0 / hits: 375  / 2 yaers ago, thu, feb 23, 2017, 09:26:03
Use this command to compare two files - one on your local machine and one on a remote machine.
test "$(md5sum /path/to/local/file | cut -d' ' -f1)" == "$(ssh root@remoteserver -- md5sum /path/to/remote/file | cut -d' ' -f1)" && echo "Match" || echo "Differ"
More From » general
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
 
Share
Sponsor
Posted
rob

rob

Member since Feb 22, 2017
Total Code Snippets: 124
Total Comments: 1
Location: n/a
Following
User not following anyone yet.
rob snippets
2 yaers ago, wed, feb 22, 2017
2 yaers ago, wed, feb 22, 2017
2 yaers ago, wed, feb 22, 2017
2 yaers ago, wed, feb 22, 2017
2 yaers ago, wed, feb 22, 2017
2 yaers ago, wed, feb 22, 2017
2 yaers ago, wed, feb 22, 2017
2 yaers ago, wed, feb 22, 2017