OSX: Generate MD5 checksum recursively in a textfile containing files with corresponding checksum

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












In a directory withmultiple subdirectories but only one folder deep containing tiff-files I'd like to generate a md5 checksum that writes the filename with the corresponding checksum into a textfile.



For example in directory TIFF I have 2 subdirectories:



TIFF
|- b0125TIFF
|- b_0000_001.tif
|- b_0000_002.tif
|- b_0000_003.tif
|- b_0000_004.tif
|- c0126TIFF
|- c_0000_001.tif
|- c_0000_002.tif
|- c_0000_003.tif
|- c_0000_004.tif


My expected textfile (checksum should be of course different):



** foo.md5:
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_001.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_002.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_003.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_004.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_001.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_002.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_003.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_004.tif


How can I achieve that?



I know that this generates the checksum recursively in one directory:



find -s . -type f -exec md5 -q ; | md5









share|improve this question





















  • This is what md5 does by default if you leave the -q flag out and give it multiple files... Are you not happy with the default output of md5?
    – Kusalananda
    Oct 3 '17 at 8:35










  • Oh, I didn't know. I started the command find -s . -type f -exec md5 -q ; | md5 and will check the result but it takes several hours (have 3TB on tiff files). Will close the question afterwards.
    – user253874
    Oct 3 '17 at 8:53















up vote
2
down vote

favorite












In a directory withmultiple subdirectories but only one folder deep containing tiff-files I'd like to generate a md5 checksum that writes the filename with the corresponding checksum into a textfile.



For example in directory TIFF I have 2 subdirectories:



TIFF
|- b0125TIFF
|- b_0000_001.tif
|- b_0000_002.tif
|- b_0000_003.tif
|- b_0000_004.tif
|- c0126TIFF
|- c_0000_001.tif
|- c_0000_002.tif
|- c_0000_003.tif
|- c_0000_004.tif


My expected textfile (checksum should be of course different):



** foo.md5:
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_001.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_002.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_003.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_004.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_001.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_002.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_003.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_004.tif


How can I achieve that?



I know that this generates the checksum recursively in one directory:



find -s . -type f -exec md5 -q ; | md5









share|improve this question





















  • This is what md5 does by default if you leave the -q flag out and give it multiple files... Are you not happy with the default output of md5?
    – Kusalananda
    Oct 3 '17 at 8:35










  • Oh, I didn't know. I started the command find -s . -type f -exec md5 -q ; | md5 and will check the result but it takes several hours (have 3TB on tiff files). Will close the question afterwards.
    – user253874
    Oct 3 '17 at 8:53













up vote
2
down vote

favorite









up vote
2
down vote

favorite











In a directory withmultiple subdirectories but only one folder deep containing tiff-files I'd like to generate a md5 checksum that writes the filename with the corresponding checksum into a textfile.



For example in directory TIFF I have 2 subdirectories:



TIFF
|- b0125TIFF
|- b_0000_001.tif
|- b_0000_002.tif
|- b_0000_003.tif
|- b_0000_004.tif
|- c0126TIFF
|- c_0000_001.tif
|- c_0000_002.tif
|- c_0000_003.tif
|- c_0000_004.tif


My expected textfile (checksum should be of course different):



** foo.md5:
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_001.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_002.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_003.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_004.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_001.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_002.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_003.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_004.tif


How can I achieve that?



I know that this generates the checksum recursively in one directory:



find -s . -type f -exec md5 -q ; | md5









share|improve this question













In a directory withmultiple subdirectories but only one folder deep containing tiff-files I'd like to generate a md5 checksum that writes the filename with the corresponding checksum into a textfile.



For example in directory TIFF I have 2 subdirectories:



TIFF
|- b0125TIFF
|- b_0000_001.tif
|- b_0000_002.tif
|- b_0000_003.tif
|- b_0000_004.tif
|- c0126TIFF
|- c_0000_001.tif
|- c_0000_002.tif
|- c_0000_003.tif
|- c_0000_004.tif


My expected textfile (checksum should be of course different):



** foo.md5:
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_001.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_002.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_003.tif
188be1dbd4f6bcfdef8d25639473e6ec *b0125TIFF/b_0000_004.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_001.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_002.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_003.tif
188be1dbd4f6bcfdef8d25639473e6ec *c0126TIFF/c_0000_004.tif


How can I achieve that?



I know that this generates the checksum recursively in one directory:



find -s . -type f -exec md5 -q ; | md5






shell-script osx hashsum






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 3 '17 at 8:22







user253874


















  • This is what md5 does by default if you leave the -q flag out and give it multiple files... Are you not happy with the default output of md5?
    – Kusalananda
    Oct 3 '17 at 8:35










  • Oh, I didn't know. I started the command find -s . -type f -exec md5 -q ; | md5 and will check the result but it takes several hours (have 3TB on tiff files). Will close the question afterwards.
    – user253874
    Oct 3 '17 at 8:53

















  • This is what md5 does by default if you leave the -q flag out and give it multiple files... Are you not happy with the default output of md5?
    – Kusalananda
    Oct 3 '17 at 8:35










  • Oh, I didn't know. I started the command find -s . -type f -exec md5 -q ; | md5 and will check the result but it takes several hours (have 3TB on tiff files). Will close the question afterwards.
    – user253874
    Oct 3 '17 at 8:53
















This is what md5 does by default if you leave the -q flag out and give it multiple files... Are you not happy with the default output of md5?
– Kusalananda
Oct 3 '17 at 8:35




This is what md5 does by default if you leave the -q flag out and give it multiple files... Are you not happy with the default output of md5?
– Kusalananda
Oct 3 '17 at 8:35












Oh, I didn't know. I started the command find -s . -type f -exec md5 -q ; | md5 and will check the result but it takes several hours (have 3TB on tiff files). Will close the question afterwards.
– user253874
Oct 3 '17 at 8:53





Oh, I didn't know. I started the command find -s . -type f -exec md5 -q ; | md5 and will check the result but it takes several hours (have 3TB on tiff files). Will close the question afterwards.
– user253874
Oct 3 '17 at 8:53











1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










You don't want to pass the output of the find and md5 through md5, that would just give you an MD5 checksum of a lot of MD5 checksums...




$ find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt
$ cat md5.txt
MD5 (TIFF/b0125TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e


The md5 implementation on macOS does not support verifying checksums with md5 -c unfortunately, but the shasum utility does:



$ find TIFF -type f -name '*.tif' -exec shasum ';' >sums.txt
$ cat sums.txt
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-3.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-3.tif

$ shasum -c sums.txt
TIFF/b0125TIFF/file-1.tif: OK
TIFF/b0125TIFF/file-2.tif: OK
TIFF/b0125TIFF/file-3.tif: OK
TIFF/c0126TIFF/file-1.tif: OK
TIFF/c0126TIFF/file-2.tif: OK
TIFF/c0126TIFF/file-3.tif: OK


shasum calculates the SHA1 hash of a file by default.






share|improve this answer






















  • The creation of md5 checksums work great, thank you very much! But when I try $ md5 -c md5.txt I get md5: illegal option -- c usage: md5 [-pqrtx] [-s string] [files ...]
    – user253874
    Oct 3 '17 at 9:22










  • @EmilyChoi Ah, the md5 on macOS does not have the -c flag. Then you may either use shasum instead or install GNU coreutils and use md5sum from there. I will add the shasum variation to my answer soon.
    – Kusalananda
    Oct 3 '17 at 9:29










  • great, thank you very much! Just a note: I was trying the "find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt" on linux and I'm getting "find: 'md5': No such file or directory" Do you know what's causing it? On OSX it works.
    – user253874
    Oct 3 '17 at 11:31










  • @EmilyChoi Yes, md5 is not available on Linux. You may try md5sum there. Use md5sum --tag (I think) to get the same format output as on macOS. There's also sha1sum that generates the same kind of output as shasum on macOS. These Linux commands come from the GNU coreutils package and are often installed by default.
    – Kusalananda
    Oct 3 '17 at 11:35






  • 1




    yes, I was too impatient. After a few minutes the filesize of sums_checked_results.txt increased from 0 bytes. Thanks for helping!
    – user253874
    Oct 4 '17 at 9:33










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395778%2fosx-generate-md5-checksum-recursively-in-a-textfile-containing-files-with-corre%23new-answer', 'question_page');

);

Post as a guest





























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










You don't want to pass the output of the find and md5 through md5, that would just give you an MD5 checksum of a lot of MD5 checksums...




$ find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt
$ cat md5.txt
MD5 (TIFF/b0125TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e


The md5 implementation on macOS does not support verifying checksums with md5 -c unfortunately, but the shasum utility does:



$ find TIFF -type f -name '*.tif' -exec shasum ';' >sums.txt
$ cat sums.txt
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-3.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-3.tif

$ shasum -c sums.txt
TIFF/b0125TIFF/file-1.tif: OK
TIFF/b0125TIFF/file-2.tif: OK
TIFF/b0125TIFF/file-3.tif: OK
TIFF/c0126TIFF/file-1.tif: OK
TIFF/c0126TIFF/file-2.tif: OK
TIFF/c0126TIFF/file-3.tif: OK


shasum calculates the SHA1 hash of a file by default.






share|improve this answer






















  • The creation of md5 checksums work great, thank you very much! But when I try $ md5 -c md5.txt I get md5: illegal option -- c usage: md5 [-pqrtx] [-s string] [files ...]
    – user253874
    Oct 3 '17 at 9:22










  • @EmilyChoi Ah, the md5 on macOS does not have the -c flag. Then you may either use shasum instead or install GNU coreutils and use md5sum from there. I will add the shasum variation to my answer soon.
    – Kusalananda
    Oct 3 '17 at 9:29










  • great, thank you very much! Just a note: I was trying the "find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt" on linux and I'm getting "find: 'md5': No such file or directory" Do you know what's causing it? On OSX it works.
    – user253874
    Oct 3 '17 at 11:31










  • @EmilyChoi Yes, md5 is not available on Linux. You may try md5sum there. Use md5sum --tag (I think) to get the same format output as on macOS. There's also sha1sum that generates the same kind of output as shasum on macOS. These Linux commands come from the GNU coreutils package and are often installed by default.
    – Kusalananda
    Oct 3 '17 at 11:35






  • 1




    yes, I was too impatient. After a few minutes the filesize of sums_checked_results.txt increased from 0 bytes. Thanks for helping!
    – user253874
    Oct 4 '17 at 9:33














up vote
1
down vote



accepted










You don't want to pass the output of the find and md5 through md5, that would just give you an MD5 checksum of a lot of MD5 checksums...




$ find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt
$ cat md5.txt
MD5 (TIFF/b0125TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e


The md5 implementation on macOS does not support verifying checksums with md5 -c unfortunately, but the shasum utility does:



$ find TIFF -type f -name '*.tif' -exec shasum ';' >sums.txt
$ cat sums.txt
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-3.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-3.tif

$ shasum -c sums.txt
TIFF/b0125TIFF/file-1.tif: OK
TIFF/b0125TIFF/file-2.tif: OK
TIFF/b0125TIFF/file-3.tif: OK
TIFF/c0126TIFF/file-1.tif: OK
TIFF/c0126TIFF/file-2.tif: OK
TIFF/c0126TIFF/file-3.tif: OK


shasum calculates the SHA1 hash of a file by default.






share|improve this answer






















  • The creation of md5 checksums work great, thank you very much! But when I try $ md5 -c md5.txt I get md5: illegal option -- c usage: md5 [-pqrtx] [-s string] [files ...]
    – user253874
    Oct 3 '17 at 9:22










  • @EmilyChoi Ah, the md5 on macOS does not have the -c flag. Then you may either use shasum instead or install GNU coreutils and use md5sum from there. I will add the shasum variation to my answer soon.
    – Kusalananda
    Oct 3 '17 at 9:29










  • great, thank you very much! Just a note: I was trying the "find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt" on linux and I'm getting "find: 'md5': No such file or directory" Do you know what's causing it? On OSX it works.
    – user253874
    Oct 3 '17 at 11:31










  • @EmilyChoi Yes, md5 is not available on Linux. You may try md5sum there. Use md5sum --tag (I think) to get the same format output as on macOS. There's also sha1sum that generates the same kind of output as shasum on macOS. These Linux commands come from the GNU coreutils package and are often installed by default.
    – Kusalananda
    Oct 3 '17 at 11:35






  • 1




    yes, I was too impatient. After a few minutes the filesize of sums_checked_results.txt increased from 0 bytes. Thanks for helping!
    – user253874
    Oct 4 '17 at 9:33












up vote
1
down vote



accepted







up vote
1
down vote



accepted






You don't want to pass the output of the find and md5 through md5, that would just give you an MD5 checksum of a lot of MD5 checksums...




$ find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt
$ cat md5.txt
MD5 (TIFF/b0125TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e


The md5 implementation on macOS does not support verifying checksums with md5 -c unfortunately, but the shasum utility does:



$ find TIFF -type f -name '*.tif' -exec shasum ';' >sums.txt
$ cat sums.txt
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-3.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-3.tif

$ shasum -c sums.txt
TIFF/b0125TIFF/file-1.tif: OK
TIFF/b0125TIFF/file-2.tif: OK
TIFF/b0125TIFF/file-3.tif: OK
TIFF/c0126TIFF/file-1.tif: OK
TIFF/c0126TIFF/file-2.tif: OK
TIFF/c0126TIFF/file-3.tif: OK


shasum calculates the SHA1 hash of a file by default.






share|improve this answer














You don't want to pass the output of the find and md5 through md5, that would just give you an MD5 checksum of a lot of MD5 checksums...




$ find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt
$ cat md5.txt
MD5 (TIFF/b0125TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/b0125TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-1.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-2.tif) = d41d8cd98f00b204e9800998ecf8427e
MD5 (TIFF/c0126TIFF/file-3.tif) = d41d8cd98f00b204e9800998ecf8427e


The md5 implementation on macOS does not support verifying checksums with md5 -c unfortunately, but the shasum utility does:



$ find TIFF -type f -name '*.tif' -exec shasum ';' >sums.txt
$ cat sums.txt
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/b0125TIFF/file-3.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-1.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-2.tif
da39a3ee5e6b4b0d3255bfef95601890afd80709 TIFF/c0126TIFF/file-3.tif

$ shasum -c sums.txt
TIFF/b0125TIFF/file-1.tif: OK
TIFF/b0125TIFF/file-2.tif: OK
TIFF/b0125TIFF/file-3.tif: OK
TIFF/c0126TIFF/file-1.tif: OK
TIFF/c0126TIFF/file-2.tif: OK
TIFF/c0126TIFF/file-3.tif: OK


shasum calculates the SHA1 hash of a file by default.







share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 3 '17 at 9:34

























answered Oct 3 '17 at 8:57









Kusalananda

105k14209326




105k14209326











  • The creation of md5 checksums work great, thank you very much! But when I try $ md5 -c md5.txt I get md5: illegal option -- c usage: md5 [-pqrtx] [-s string] [files ...]
    – user253874
    Oct 3 '17 at 9:22










  • @EmilyChoi Ah, the md5 on macOS does not have the -c flag. Then you may either use shasum instead or install GNU coreutils and use md5sum from there. I will add the shasum variation to my answer soon.
    – Kusalananda
    Oct 3 '17 at 9:29










  • great, thank you very much! Just a note: I was trying the "find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt" on linux and I'm getting "find: 'md5': No such file or directory" Do you know what's causing it? On OSX it works.
    – user253874
    Oct 3 '17 at 11:31










  • @EmilyChoi Yes, md5 is not available on Linux. You may try md5sum there. Use md5sum --tag (I think) to get the same format output as on macOS. There's also sha1sum that generates the same kind of output as shasum on macOS. These Linux commands come from the GNU coreutils package and are often installed by default.
    – Kusalananda
    Oct 3 '17 at 11:35






  • 1




    yes, I was too impatient. After a few minutes the filesize of sums_checked_results.txt increased from 0 bytes. Thanks for helping!
    – user253874
    Oct 4 '17 at 9:33
















  • The creation of md5 checksums work great, thank you very much! But when I try $ md5 -c md5.txt I get md5: illegal option -- c usage: md5 [-pqrtx] [-s string] [files ...]
    – user253874
    Oct 3 '17 at 9:22










  • @EmilyChoi Ah, the md5 on macOS does not have the -c flag. Then you may either use shasum instead or install GNU coreutils and use md5sum from there. I will add the shasum variation to my answer soon.
    – Kusalananda
    Oct 3 '17 at 9:29










  • great, thank you very much! Just a note: I was trying the "find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt" on linux and I'm getting "find: 'md5': No such file or directory" Do you know what's causing it? On OSX it works.
    – user253874
    Oct 3 '17 at 11:31










  • @EmilyChoi Yes, md5 is not available on Linux. You may try md5sum there. Use md5sum --tag (I think) to get the same format output as on macOS. There's also sha1sum that generates the same kind of output as shasum on macOS. These Linux commands come from the GNU coreutils package and are often installed by default.
    – Kusalananda
    Oct 3 '17 at 11:35






  • 1




    yes, I was too impatient. After a few minutes the filesize of sums_checked_results.txt increased from 0 bytes. Thanks for helping!
    – user253874
    Oct 4 '17 at 9:33















The creation of md5 checksums work great, thank you very much! But when I try $ md5 -c md5.txt I get md5: illegal option -- c usage: md5 [-pqrtx] [-s string] [files ...]
– user253874
Oct 3 '17 at 9:22




The creation of md5 checksums work great, thank you very much! But when I try $ md5 -c md5.txt I get md5: illegal option -- c usage: md5 [-pqrtx] [-s string] [files ...]
– user253874
Oct 3 '17 at 9:22












@EmilyChoi Ah, the md5 on macOS does not have the -c flag. Then you may either use shasum instead or install GNU coreutils and use md5sum from there. I will add the shasum variation to my answer soon.
– Kusalananda
Oct 3 '17 at 9:29




@EmilyChoi Ah, the md5 on macOS does not have the -c flag. Then you may either use shasum instead or install GNU coreutils and use md5sum from there. I will add the shasum variation to my answer soon.
– Kusalananda
Oct 3 '17 at 9:29












great, thank you very much! Just a note: I was trying the "find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt" on linux and I'm getting "find: 'md5': No such file or directory" Do you know what's causing it? On OSX it works.
– user253874
Oct 3 '17 at 11:31




great, thank you very much! Just a note: I was trying the "find TIFF -type f -name '*.tif' -exec md5 ';' >md5.txt" on linux and I'm getting "find: 'md5': No such file or directory" Do you know what's causing it? On OSX it works.
– user253874
Oct 3 '17 at 11:31












@EmilyChoi Yes, md5 is not available on Linux. You may try md5sum there. Use md5sum --tag (I think) to get the same format output as on macOS. There's also sha1sum that generates the same kind of output as shasum on macOS. These Linux commands come from the GNU coreutils package and are often installed by default.
– Kusalananda
Oct 3 '17 at 11:35




@EmilyChoi Yes, md5 is not available on Linux. You may try md5sum there. Use md5sum --tag (I think) to get the same format output as on macOS. There's also sha1sum that generates the same kind of output as shasum on macOS. These Linux commands come from the GNU coreutils package and are often installed by default.
– Kusalananda
Oct 3 '17 at 11:35




1




1




yes, I was too impatient. After a few minutes the filesize of sums_checked_results.txt increased from 0 bytes. Thanks for helping!
– user253874
Oct 4 '17 at 9:33




yes, I was too impatient. After a few minutes the filesize of sums_checked_results.txt increased from 0 bytes. Thanks for helping!
– user253874
Oct 4 '17 at 9:33

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395778%2fosx-generate-md5-checksum-recursively-in-a-textfile-containing-files-with-corre%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?