Hello.
Here is the situation:
I am copying large files from one drive to another and I want make sure that the copies are exact duplicates of the original. So to do that, I can check the hashes of the original file and compare it to the hashes of duplicate. However, when copying huge files, checking the file hashes of the first file can take a while depending on the computer's speed. So I have to wait for it to finish, then check the hashes of the second file again. This also means that I have to type two separate commands. I wish there is a feature in md5sum that checks the hashes of two (or more) files and compare them after checking, but I don't think that feature exists yet.
The question:
What command do I have to use (using pipes) to merge both commands and compare them in one line?
example: $ compare (md5sum /home/myfile.iso) (md5sum /media/hd2/myfile.iso)
or $ compare `md5sum /home/myfile.iso` `md5sum /media/hd2/myfile.iso`
Note: The "compare" command in my example does not exist. I only used it to help me while explaining.
Thank you!
ps. I am not good in bash yet, but I want to (and trying to) learn!
Here is the situation:
I am copying large files from one drive to another and I want make sure that the copies are exact duplicates of the original. So to do that, I can check the hashes of the original file and compare it to the hashes of duplicate. However, when copying huge files, checking the file hashes of the first file can take a while depending on the computer's speed. So I have to wait for it to finish, then check the hashes of the second file again. This also means that I have to type two separate commands. I wish there is a feature in md5sum that checks the hashes of two (or more) files and compare them after checking, but I don't think that feature exists yet.
The question:
What command do I have to use (using pipes) to merge both commands and compare them in one line?
example: $ compare (md5sum /home/myfile.iso) (md5sum /media/hd2/myfile.iso)
or $ compare `md5sum /home/myfile.iso` `md5sum /media/hd2/myfile.iso`
Note: The "compare" command in my example does not exist. I only used it to help me while explaining.
Thank you!
ps. I am not good in bash yet, but I want to (and trying to) learn!
Comment