Generate MD5sum for all files in a directory, and then write (filename).md5 for each file containing that file's MD5SUM

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a directory full of files. Each file will be copied to a specific type of destination host.
I want to calculate an MD5 sum for each file in the directory, and store that md5 sum in a file that matches the name of the file that generated the sum, but with .md5 appended.
So, for instance, if I have a directory with:
a.bin
b.bin
c.bin
The final result should be:
a.bin
a.bin.md5 # a.bin's calculated checksum
b.bin
b.bin.md5 # b.bin's calculated checksum
c.bin
c.bin.md5 # c.bin's calculated checksum
I have attempted this with find exec, and with xargs.
With find, I tried this command:
find . -type f -exec md5sum + > .md5
Using xargs, I tried this command:
find . -type f | xargs -I md5sum > .md5
In either case, I end up with a file called .txt, which isn't really what I am looking for.
Could anyone point out how to tweak these to generate the md5 files I am looking to generate?
bash hashsum
add a comment |Â
up vote
1
down vote
favorite
I have a directory full of files. Each file will be copied to a specific type of destination host.
I want to calculate an MD5 sum for each file in the directory, and store that md5 sum in a file that matches the name of the file that generated the sum, but with .md5 appended.
So, for instance, if I have a directory with:
a.bin
b.bin
c.bin
The final result should be:
a.bin
a.bin.md5 # a.bin's calculated checksum
b.bin
b.bin.md5 # b.bin's calculated checksum
c.bin
c.bin.md5 # c.bin's calculated checksum
I have attempted this with find exec, and with xargs.
With find, I tried this command:
find . -type f -exec md5sum + > .md5
Using xargs, I tried this command:
find . -type f | xargs -I md5sum > .md5
In either case, I end up with a file called .txt, which isn't really what I am looking for.
Could anyone point out how to tweak these to generate the md5 files I am looking to generate?
bash hashsum
1
Dumping all the output to a single file will let you usemd5sum -clater to verify all files at once.
â Ignacio Vazquez-Abrams
Nov 6 '17 at 20:21
The problem is we won't be copying all files to the destinations. Only one file will be copied. So, we'd end up with a monolithic file listing files that mostly aren't present on the destination hosts. Using the example above, some hosts get a.bin, some get b.bin. The a.bin hosts don't need md5sum info for b.bin and c.bin. I hope that makes sense. :)
â Matthew
Nov 6 '17 at 20:38
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a directory full of files. Each file will be copied to a specific type of destination host.
I want to calculate an MD5 sum for each file in the directory, and store that md5 sum in a file that matches the name of the file that generated the sum, but with .md5 appended.
So, for instance, if I have a directory with:
a.bin
b.bin
c.bin
The final result should be:
a.bin
a.bin.md5 # a.bin's calculated checksum
b.bin
b.bin.md5 # b.bin's calculated checksum
c.bin
c.bin.md5 # c.bin's calculated checksum
I have attempted this with find exec, and with xargs.
With find, I tried this command:
find . -type f -exec md5sum + > .md5
Using xargs, I tried this command:
find . -type f | xargs -I md5sum > .md5
In either case, I end up with a file called .txt, which isn't really what I am looking for.
Could anyone point out how to tweak these to generate the md5 files I am looking to generate?
bash hashsum
I have a directory full of files. Each file will be copied to a specific type of destination host.
I want to calculate an MD5 sum for each file in the directory, and store that md5 sum in a file that matches the name of the file that generated the sum, but with .md5 appended.
So, for instance, if I have a directory with:
a.bin
b.bin
c.bin
The final result should be:
a.bin
a.bin.md5 # a.bin's calculated checksum
b.bin
b.bin.md5 # b.bin's calculated checksum
c.bin
c.bin.md5 # c.bin's calculated checksum
I have attempted this with find exec, and with xargs.
With find, I tried this command:
find . -type f -exec md5sum + > .md5
Using xargs, I tried this command:
find . -type f | xargs -I md5sum > .md5
In either case, I end up with a file called .txt, which isn't really what I am looking for.
Could anyone point out how to tweak these to generate the md5 files I am looking to generate?
bash hashsum
asked Nov 6 '17 at 20:10
Matthew
1165
1165
1
Dumping all the output to a single file will let you usemd5sum -clater to verify all files at once.
â Ignacio Vazquez-Abrams
Nov 6 '17 at 20:21
The problem is we won't be copying all files to the destinations. Only one file will be copied. So, we'd end up with a monolithic file listing files that mostly aren't present on the destination hosts. Using the example above, some hosts get a.bin, some get b.bin. The a.bin hosts don't need md5sum info for b.bin and c.bin. I hope that makes sense. :)
â Matthew
Nov 6 '17 at 20:38
add a comment |Â
1
Dumping all the output to a single file will let you usemd5sum -clater to verify all files at once.
â Ignacio Vazquez-Abrams
Nov 6 '17 at 20:21
The problem is we won't be copying all files to the destinations. Only one file will be copied. So, we'd end up with a monolithic file listing files that mostly aren't present on the destination hosts. Using the example above, some hosts get a.bin, some get b.bin. The a.bin hosts don't need md5sum info for b.bin and c.bin. I hope that makes sense. :)
â Matthew
Nov 6 '17 at 20:38
1
1
Dumping all the output to a single file will let you use
md5sum -c later to verify all files at once.â Ignacio Vazquez-Abrams
Nov 6 '17 at 20:21
Dumping all the output to a single file will let you use
md5sum -c later to verify all files at once.â Ignacio Vazquez-Abrams
Nov 6 '17 at 20:21
The problem is we won't be copying all files to the destinations. Only one file will be copied. So, we'd end up with a monolithic file listing files that mostly aren't present on the destination hosts. Using the example above, some hosts get a.bin, some get b.bin. The a.bin hosts don't need md5sum info for b.bin and c.bin. I hope that makes sense. :)
â Matthew
Nov 6 '17 at 20:38
The problem is we won't be copying all files to the destinations. Only one file will be copied. So, we'd end up with a monolithic file listing files that mostly aren't present on the destination hosts. Using the example above, some hosts get a.bin, some get b.bin. The a.bin hosts don't need md5sum info for b.bin and c.bin. I hope that makes sense. :)
â Matthew
Nov 6 '17 at 20:38
add a comment |Â
5 Answers
5
active
oldest
votes
up vote
2
down vote
accepted
cd /path/to/files &&
for file in *; do
if [[ -f "$file" ]]; then
md5sum -- "$file" > "$file.md5"
fi
done
Works perfectly, thank you!
â Matthew
Nov 6 '17 at 20:19
add a comment |Â
up vote
2
down vote
Redirection is an operator of the shell.
In:
find some args > .md5
find is run with some args and its stdout redirected to .md5.
Here, you'd need find to start a shell to perform one redirection for each file:
find . -type f -exec sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
If you want to avoid the directory component in the .md5 part, you can either use the -execdir alternatives supported by many find implementations (though with some you'll still get a ./ directory component, and with some, that will still run one shell per file even with +:
find . -type f -execdir sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
Or you can do it as:
find . -type f -exec sh -c '
for file do
(cd "${file%/*" && exec md5sum -- "$file##*/") > "$file.md5"
done' sh +
add a comment |Â
up vote
0
down vote
I know there are side effects to piping into a while loop, but I like the simplicilty, readability and extensibilty of this solution
find . -type f ! -name *.md5 |
while read a; do md5sum $a > $a.md5; done
To use this scipplet to check sums simply:
find . -type f ! -name *.md5 |
while read a; do echo $a; md5sum -c $a.md5; done
add a comment |Â
up vote
-1
down vote
find . -name '*.iso' -type f -exec sh -c "ls -lh ; pv | md5sum > .md5" ;
optional
ls -lh ;
to show processing file, and
pv
to show progressbar on big (slow) iso file in my case
Looks OK, but you're restricting it to .iso files.
â telcoM
Jan 20 at 17:50
add a comment |Â
up vote
-1
down vote
cd /path/to/files && ls -1| xargs md5sum | xargs -l bash -c 'echo $0" "$1 > $1.md5'
first xargs generate , second xargs picks up and save to .md5
If you need filter file patter, you can replace ls with find or add grep afterwards.
Parses output oflsand uses unquoted variable expansions.
â Kusalananda
Feb 1 at 17:43
Can you explain your comments? you can replace ls with find or any other command.
â Ming Jia
Feb 1 at 19:12
Assume spaces in any of the names in thefilesdirectory, for example. Also consider what would happen if one of the names is a directory.
â Kusalananda
Feb 2 at 6:33
@MingJia Parsing output oflsis considered generally bad practice (see this ). Even if there aren't any difficult filenames, that doesn't mean one shouldn't anticipate them. Second big problem is the$0and$1should be double-quoted. Because of "word splitting", if you have file with spaces or tabs in filename, ` > $1` will haveambiguous redirecterror. Tryvar="with space.txt"; echo "hi" > $varand thenvar="with space.txt"; echo "hi" > "$var"
â Sergiy Kolodyazhnyy
Feb 2 at 6:55
@MingJia Don't get discouraged, you'll learn to pick up on these things if you stick around on the site, with time of course. Welcome, to the site and consider re-working your answer.
â Sergiy Kolodyazhnyy
Feb 2 at 6:57
 |Â
show 1 more comment
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
cd /path/to/files &&
for file in *; do
if [[ -f "$file" ]]; then
md5sum -- "$file" > "$file.md5"
fi
done
Works perfectly, thank you!
â Matthew
Nov 6 '17 at 20:19
add a comment |Â
up vote
2
down vote
accepted
cd /path/to/files &&
for file in *; do
if [[ -f "$file" ]]; then
md5sum -- "$file" > "$file.md5"
fi
done
Works perfectly, thank you!
â Matthew
Nov 6 '17 at 20:19
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
cd /path/to/files &&
for file in *; do
if [[ -f "$file" ]]; then
md5sum -- "$file" > "$file.md5"
fi
done
cd /path/to/files &&
for file in *; do
if [[ -f "$file" ]]; then
md5sum -- "$file" > "$file.md5"
fi
done
edited Nov 7 '17 at 9:04
Stéphane Chazelas
283k53521854
283k53521854
answered Nov 6 '17 at 20:13
DopeGhoti
40.6k54979
40.6k54979
Works perfectly, thank you!
â Matthew
Nov 6 '17 at 20:19
add a comment |Â
Works perfectly, thank you!
â Matthew
Nov 6 '17 at 20:19
Works perfectly, thank you!
â Matthew
Nov 6 '17 at 20:19
Works perfectly, thank you!
â Matthew
Nov 6 '17 at 20:19
add a comment |Â
up vote
2
down vote
Redirection is an operator of the shell.
In:
find some args > .md5
find is run with some args and its stdout redirected to .md5.
Here, you'd need find to start a shell to perform one redirection for each file:
find . -type f -exec sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
If you want to avoid the directory component in the .md5 part, you can either use the -execdir alternatives supported by many find implementations (though with some you'll still get a ./ directory component, and with some, that will still run one shell per file even with +:
find . -type f -execdir sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
Or you can do it as:
find . -type f -exec sh -c '
for file do
(cd "${file%/*" && exec md5sum -- "$file##*/") > "$file.md5"
done' sh +
add a comment |Â
up vote
2
down vote
Redirection is an operator of the shell.
In:
find some args > .md5
find is run with some args and its stdout redirected to .md5.
Here, you'd need find to start a shell to perform one redirection for each file:
find . -type f -exec sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
If you want to avoid the directory component in the .md5 part, you can either use the -execdir alternatives supported by many find implementations (though with some you'll still get a ./ directory component, and with some, that will still run one shell per file even with +:
find . -type f -execdir sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
Or you can do it as:
find . -type f -exec sh -c '
for file do
(cd "${file%/*" && exec md5sum -- "$file##*/") > "$file.md5"
done' sh +
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Redirection is an operator of the shell.
In:
find some args > .md5
find is run with some args and its stdout redirected to .md5.
Here, you'd need find to start a shell to perform one redirection for each file:
find . -type f -exec sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
If you want to avoid the directory component in the .md5 part, you can either use the -execdir alternatives supported by many find implementations (though with some you'll still get a ./ directory component, and with some, that will still run one shell per file even with +:
find . -type f -execdir sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
Or you can do it as:
find . -type f -exec sh -c '
for file do
(cd "${file%/*" && exec md5sum -- "$file##*/") > "$file.md5"
done' sh +
Redirection is an operator of the shell.
In:
find some args > .md5
find is run with some args and its stdout redirected to .md5.
Here, you'd need find to start a shell to perform one redirection for each file:
find . -type f -exec sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
If you want to avoid the directory component in the .md5 part, you can either use the -execdir alternatives supported by many find implementations (though with some you'll still get a ./ directory component, and with some, that will still run one shell per file even with +:
find . -type f -execdir sh -c '
for file do
md5sum "$file" > "$file.md5"
done' sh +
Or you can do it as:
find . -type f -exec sh -c '
for file do
(cd "${file%/*" && exec md5sum -- "$file##*/") > "$file.md5"
done' sh +
edited Nov 7 '17 at 9:09
answered Nov 6 '17 at 21:36
Stéphane Chazelas
283k53521854
283k53521854
add a comment |Â
add a comment |Â
up vote
0
down vote
I know there are side effects to piping into a while loop, but I like the simplicilty, readability and extensibilty of this solution
find . -type f ! -name *.md5 |
while read a; do md5sum $a > $a.md5; done
To use this scipplet to check sums simply:
find . -type f ! -name *.md5 |
while read a; do echo $a; md5sum -c $a.md5; done
add a comment |Â
up vote
0
down vote
I know there are side effects to piping into a while loop, but I like the simplicilty, readability and extensibilty of this solution
find . -type f ! -name *.md5 |
while read a; do md5sum $a > $a.md5; done
To use this scipplet to check sums simply:
find . -type f ! -name *.md5 |
while read a; do echo $a; md5sum -c $a.md5; done
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I know there are side effects to piping into a while loop, but I like the simplicilty, readability and extensibilty of this solution
find . -type f ! -name *.md5 |
while read a; do md5sum $a > $a.md5; done
To use this scipplet to check sums simply:
find . -type f ! -name *.md5 |
while read a; do echo $a; md5sum -c $a.md5; done
I know there are side effects to piping into a while loop, but I like the simplicilty, readability and extensibilty of this solution
find . -type f ! -name *.md5 |
while read a; do md5sum $a > $a.md5; done
To use this scipplet to check sums simply:
find . -type f ! -name *.md5 |
while read a; do echo $a; md5sum -c $a.md5; done
answered Jan 20 at 18:15
Stefan
863
863
add a comment |Â
add a comment |Â
up vote
-1
down vote
find . -name '*.iso' -type f -exec sh -c "ls -lh ; pv | md5sum > .md5" ;
optional
ls -lh ;
to show processing file, and
pv
to show progressbar on big (slow) iso file in my case
Looks OK, but you're restricting it to .iso files.
â telcoM
Jan 20 at 17:50
add a comment |Â
up vote
-1
down vote
find . -name '*.iso' -type f -exec sh -c "ls -lh ; pv | md5sum > .md5" ;
optional
ls -lh ;
to show processing file, and
pv
to show progressbar on big (slow) iso file in my case
Looks OK, but you're restricting it to .iso files.
â telcoM
Jan 20 at 17:50
add a comment |Â
up vote
-1
down vote
up vote
-1
down vote
find . -name '*.iso' -type f -exec sh -c "ls -lh ; pv | md5sum > .md5" ;
optional
ls -lh ;
to show processing file, and
pv
to show progressbar on big (slow) iso file in my case
find . -name '*.iso' -type f -exec sh -c "ls -lh ; pv | md5sum > .md5" ;
optional
ls -lh ;
to show processing file, and
pv
to show progressbar on big (slow) iso file in my case
answered Jan 20 at 14:34
f7r
1
1
Looks OK, but you're restricting it to .iso files.
â telcoM
Jan 20 at 17:50
add a comment |Â
Looks OK, but you're restricting it to .iso files.
â telcoM
Jan 20 at 17:50
Looks OK, but you're restricting it to .iso files.
â telcoM
Jan 20 at 17:50
Looks OK, but you're restricting it to .iso files.
â telcoM
Jan 20 at 17:50
add a comment |Â
up vote
-1
down vote
cd /path/to/files && ls -1| xargs md5sum | xargs -l bash -c 'echo $0" "$1 > $1.md5'
first xargs generate , second xargs picks up and save to .md5
If you need filter file patter, you can replace ls with find or add grep afterwards.
Parses output oflsand uses unquoted variable expansions.
â Kusalananda
Feb 1 at 17:43
Can you explain your comments? you can replace ls with find or any other command.
â Ming Jia
Feb 1 at 19:12
Assume spaces in any of the names in thefilesdirectory, for example. Also consider what would happen if one of the names is a directory.
â Kusalananda
Feb 2 at 6:33
@MingJia Parsing output oflsis considered generally bad practice (see this ). Even if there aren't any difficult filenames, that doesn't mean one shouldn't anticipate them. Second big problem is the$0and$1should be double-quoted. Because of "word splitting", if you have file with spaces or tabs in filename, ` > $1` will haveambiguous redirecterror. Tryvar="with space.txt"; echo "hi" > $varand thenvar="with space.txt"; echo "hi" > "$var"
â Sergiy Kolodyazhnyy
Feb 2 at 6:55
@MingJia Don't get discouraged, you'll learn to pick up on these things if you stick around on the site, with time of course. Welcome, to the site and consider re-working your answer.
â Sergiy Kolodyazhnyy
Feb 2 at 6:57
 |Â
show 1 more comment
up vote
-1
down vote
cd /path/to/files && ls -1| xargs md5sum | xargs -l bash -c 'echo $0" "$1 > $1.md5'
first xargs generate , second xargs picks up and save to .md5
If you need filter file patter, you can replace ls with find or add grep afterwards.
Parses output oflsand uses unquoted variable expansions.
â Kusalananda
Feb 1 at 17:43
Can you explain your comments? you can replace ls with find or any other command.
â Ming Jia
Feb 1 at 19:12
Assume spaces in any of the names in thefilesdirectory, for example. Also consider what would happen if one of the names is a directory.
â Kusalananda
Feb 2 at 6:33
@MingJia Parsing output oflsis considered generally bad practice (see this ). Even if there aren't any difficult filenames, that doesn't mean one shouldn't anticipate them. Second big problem is the$0and$1should be double-quoted. Because of "word splitting", if you have file with spaces or tabs in filename, ` > $1` will haveambiguous redirecterror. Tryvar="with space.txt"; echo "hi" > $varand thenvar="with space.txt"; echo "hi" > "$var"
â Sergiy Kolodyazhnyy
Feb 2 at 6:55
@MingJia Don't get discouraged, you'll learn to pick up on these things if you stick around on the site, with time of course. Welcome, to the site and consider re-working your answer.
â Sergiy Kolodyazhnyy
Feb 2 at 6:57
 |Â
show 1 more comment
up vote
-1
down vote
up vote
-1
down vote
cd /path/to/files && ls -1| xargs md5sum | xargs -l bash -c 'echo $0" "$1 > $1.md5'
first xargs generate , second xargs picks up and save to .md5
If you need filter file patter, you can replace ls with find or add grep afterwards.
cd /path/to/files && ls -1| xargs md5sum | xargs -l bash -c 'echo $0" "$1 > $1.md5'
first xargs generate , second xargs picks up and save to .md5
If you need filter file patter, you can replace ls with find or add grep afterwards.
edited Feb 1 at 19:10
answered Feb 1 at 17:41
Ming Jia
12
12
Parses output oflsand uses unquoted variable expansions.
â Kusalananda
Feb 1 at 17:43
Can you explain your comments? you can replace ls with find or any other command.
â Ming Jia
Feb 1 at 19:12
Assume spaces in any of the names in thefilesdirectory, for example. Also consider what would happen if one of the names is a directory.
â Kusalananda
Feb 2 at 6:33
@MingJia Parsing output oflsis considered generally bad practice (see this ). Even if there aren't any difficult filenames, that doesn't mean one shouldn't anticipate them. Second big problem is the$0and$1should be double-quoted. Because of "word splitting", if you have file with spaces or tabs in filename, ` > $1` will haveambiguous redirecterror. Tryvar="with space.txt"; echo "hi" > $varand thenvar="with space.txt"; echo "hi" > "$var"
â Sergiy Kolodyazhnyy
Feb 2 at 6:55
@MingJia Don't get discouraged, you'll learn to pick up on these things if you stick around on the site, with time of course. Welcome, to the site and consider re-working your answer.
â Sergiy Kolodyazhnyy
Feb 2 at 6:57
 |Â
show 1 more comment
Parses output oflsand uses unquoted variable expansions.
â Kusalananda
Feb 1 at 17:43
Can you explain your comments? you can replace ls with find or any other command.
â Ming Jia
Feb 1 at 19:12
Assume spaces in any of the names in thefilesdirectory, for example. Also consider what would happen if one of the names is a directory.
â Kusalananda
Feb 2 at 6:33
@MingJia Parsing output oflsis considered generally bad practice (see this ). Even if there aren't any difficult filenames, that doesn't mean one shouldn't anticipate them. Second big problem is the$0and$1should be double-quoted. Because of "word splitting", if you have file with spaces or tabs in filename, ` > $1` will haveambiguous redirecterror. Tryvar="with space.txt"; echo "hi" > $varand thenvar="with space.txt"; echo "hi" > "$var"
â Sergiy Kolodyazhnyy
Feb 2 at 6:55
@MingJia Don't get discouraged, you'll learn to pick up on these things if you stick around on the site, with time of course. Welcome, to the site and consider re-working your answer.
â Sergiy Kolodyazhnyy
Feb 2 at 6:57
Parses output of
ls and uses unquoted variable expansions.â Kusalananda
Feb 1 at 17:43
Parses output of
ls and uses unquoted variable expansions.â Kusalananda
Feb 1 at 17:43
Can you explain your comments? you can replace ls with find or any other command.
â Ming Jia
Feb 1 at 19:12
Can you explain your comments? you can replace ls with find or any other command.
â Ming Jia
Feb 1 at 19:12
Assume spaces in any of the names in the
files directory, for example. Also consider what would happen if one of the names is a directory.â Kusalananda
Feb 2 at 6:33
Assume spaces in any of the names in the
files directory, for example. Also consider what would happen if one of the names is a directory.â Kusalananda
Feb 2 at 6:33
@MingJia Parsing output of
ls is considered generally bad practice (see this ). Even if there aren't any difficult filenames, that doesn't mean one shouldn't anticipate them. Second big problem is the $0 and $1 should be double-quoted. Because of "word splitting", if you have file with spaces or tabs in filename, ` > $1` will have ambiguous redirect error. Try var="with space.txt"; echo "hi" > $var and then var="with space.txt"; echo "hi" > "$var"â Sergiy Kolodyazhnyy
Feb 2 at 6:55
@MingJia Parsing output of
ls is considered generally bad practice (see this ). Even if there aren't any difficult filenames, that doesn't mean one shouldn't anticipate them. Second big problem is the $0 and $1 should be double-quoted. Because of "word splitting", if you have file with spaces or tabs in filename, ` > $1` will have ambiguous redirect error. Try var="with space.txt"; echo "hi" > $var and then var="with space.txt"; echo "hi" > "$var"â Sergiy Kolodyazhnyy
Feb 2 at 6:55
@MingJia Don't get discouraged, you'll learn to pick up on these things if you stick around on the site, with time of course. Welcome, to the site and consider re-working your answer.
â Sergiy Kolodyazhnyy
Feb 2 at 6:57
@MingJia Don't get discouraged, you'll learn to pick up on these things if you stick around on the site, with time of course. Welcome, to the site and consider re-working your answer.
â Sergiy Kolodyazhnyy
Feb 2 at 6:57
 |Â
show 1 more comment
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402907%2fgenerate-md5sum-for-all-files-in-a-directory-and-then-write-filename-md5-for%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Dumping all the output to a single file will let you use
md5sum -clater to verify all files at once.â Ignacio Vazquez-Abrams
Nov 6 '17 at 20:21
The problem is we won't be copying all files to the destinations. Only one file will be copied. So, we'd end up with a monolithic file listing files that mostly aren't present on the destination hosts. Using the example above, some hosts get a.bin, some get b.bin. The a.bin hosts don't need md5sum info for b.bin and c.bin. I hope that makes sense. :)
â Matthew
Nov 6 '17 at 20:38