SHASUMS AND grep in verifying Ubuntu download
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I'm trying to better understand the use of "SHA256SUMS" and "grep." The Ubuntu verify and authenticate tutorial uses the following term: "sha256sum -c SHA256SUMS 2>&1 | grep OK" to verify the download hasn't been corrupted.
I understand it's checking at the SHA256SUMS file that contains two hash values, one for the Desktop version and one for the Live. The usage worked, and I checked it by manually verifying the hash values.
My question is what is the "SHA256SUMS 2>&1" portion doing? Also, it appears to be a part of the "SHA256SUMS" command, though I don't see that usage on the man page I use. Then somehow the result is piped to "grep" to pattern-match with no options.
I'd like to understand it well enough to use the technique in verifying that other software downloads haven't been corrupted.
command-line grep checksums sha256
add a comment |Â
up vote
3
down vote
favorite
I'm trying to better understand the use of "SHA256SUMS" and "grep." The Ubuntu verify and authenticate tutorial uses the following term: "sha256sum -c SHA256SUMS 2>&1 | grep OK" to verify the download hasn't been corrupted.
I understand it's checking at the SHA256SUMS file that contains two hash values, one for the Desktop version and one for the Live. The usage worked, and I checked it by manually verifying the hash values.
My question is what is the "SHA256SUMS 2>&1" portion doing? Also, it appears to be a part of the "SHA256SUMS" command, though I don't see that usage on the man page I use. Then somehow the result is piped to "grep" to pattern-match with no options.
I'd like to understand it well enough to use the technique in verifying that other software downloads haven't been corrupted.
command-line grep checksums sha256
Related: What do these symbols âÂÂ$@âÂÂ>/dev/null 2>&1" after a command mean?
â steeldriver
Sep 8 at 13:44
The command issha256sum -c SHA256SUMS
;2>&1
is a shell redirection that combines the command's standard error stream2
with its standard output stream1
so that both are piped to thegrep
command
â steeldriver
Sep 8 at 13:47
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'm trying to better understand the use of "SHA256SUMS" and "grep." The Ubuntu verify and authenticate tutorial uses the following term: "sha256sum -c SHA256SUMS 2>&1 | grep OK" to verify the download hasn't been corrupted.
I understand it's checking at the SHA256SUMS file that contains two hash values, one for the Desktop version and one for the Live. The usage worked, and I checked it by manually verifying the hash values.
My question is what is the "SHA256SUMS 2>&1" portion doing? Also, it appears to be a part of the "SHA256SUMS" command, though I don't see that usage on the man page I use. Then somehow the result is piped to "grep" to pattern-match with no options.
I'd like to understand it well enough to use the technique in verifying that other software downloads haven't been corrupted.
command-line grep checksums sha256
I'm trying to better understand the use of "SHA256SUMS" and "grep." The Ubuntu verify and authenticate tutorial uses the following term: "sha256sum -c SHA256SUMS 2>&1 | grep OK" to verify the download hasn't been corrupted.
I understand it's checking at the SHA256SUMS file that contains two hash values, one for the Desktop version and one for the Live. The usage worked, and I checked it by manually verifying the hash values.
My question is what is the "SHA256SUMS 2>&1" portion doing? Also, it appears to be a part of the "SHA256SUMS" command, though I don't see that usage on the man page I use. Then somehow the result is piped to "grep" to pattern-match with no options.
I'd like to understand it well enough to use the technique in verifying that other software downloads haven't been corrupted.
command-line grep checksums sha256
command-line grep checksums sha256
asked Sep 8 at 13:35
JWNWSA
426
426
Related: What do these symbols âÂÂ$@âÂÂ>/dev/null 2>&1" after a command mean?
â steeldriver
Sep 8 at 13:44
The command issha256sum -c SHA256SUMS
;2>&1
is a shell redirection that combines the command's standard error stream2
with its standard output stream1
so that both are piped to thegrep
command
â steeldriver
Sep 8 at 13:47
add a comment |Â
Related: What do these symbols âÂÂ$@âÂÂ>/dev/null 2>&1" after a command mean?
â steeldriver
Sep 8 at 13:44
The command issha256sum -c SHA256SUMS
;2>&1
is a shell redirection that combines the command's standard error stream2
with its standard output stream1
so that both are piped to thegrep
command
â steeldriver
Sep 8 at 13:47
Related: What do these symbols âÂÂ$@âÂÂ>/dev/null 2>&1" after a command mean?
â steeldriver
Sep 8 at 13:44
Related: What do these symbols âÂÂ$@âÂÂ>/dev/null 2>&1" after a command mean?
â steeldriver
Sep 8 at 13:44
The command is
sha256sum -c SHA256SUMS
; 2>&1
is a shell redirection that combines the command's standard error stream 2
with its standard output stream 1
so that both are piped to the grep
commandâ steeldriver
Sep 8 at 13:47
The command is
sha256sum -c SHA256SUMS
; 2>&1
is a shell redirection that combines the command's standard error stream 2
with its standard output stream 1
so that both are piped to the grep
commandâ steeldriver
Sep 8 at 13:47
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
The grep
command is just there to clean up the output for you. The hash checker checks against all the disk images, so the grep command keeps things simple.
With grep:
ubuntu-core-16-amd64.img.xz: OK
Without grep:
ubuntu-core-16-amd64.img.xz: OK
sha256sum: ubuntu-core-16-cm3.img.xz: No such file or directory
ubuntu-core-16-cm3.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard-410c.img.xz: No such file or directory
ubuntu-core-16-dragonboard-410c.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard.img.xz: No such file or directory
ubuntu-core-16-dragonboard.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-i386.img.xz: No such file or directory
ubuntu-core-16-i386.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi2.img.xz: No such file or directory
ubuntu-core-16-pi2.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi3.img.xz: No such file or directory
ubuntu-core-16-pi3.img.xz: FAILED open or read
sha256sum: WARNING: 6 listed files could not be read
Update:
Sorry, I missed the 2>&1
part of your question. That portion directs any error messages to the same place as the standard output messages. This page explains that quirky idiom: https://www.brianstorti.com/understanding-shell-script-idiom-redirect/
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
The grep
command is just there to clean up the output for you. The hash checker checks against all the disk images, so the grep command keeps things simple.
With grep:
ubuntu-core-16-amd64.img.xz: OK
Without grep:
ubuntu-core-16-amd64.img.xz: OK
sha256sum: ubuntu-core-16-cm3.img.xz: No such file or directory
ubuntu-core-16-cm3.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard-410c.img.xz: No such file or directory
ubuntu-core-16-dragonboard-410c.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard.img.xz: No such file or directory
ubuntu-core-16-dragonboard.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-i386.img.xz: No such file or directory
ubuntu-core-16-i386.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi2.img.xz: No such file or directory
ubuntu-core-16-pi2.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi3.img.xz: No such file or directory
ubuntu-core-16-pi3.img.xz: FAILED open or read
sha256sum: WARNING: 6 listed files could not be read
Update:
Sorry, I missed the 2>&1
part of your question. That portion directs any error messages to the same place as the standard output messages. This page explains that quirky idiom: https://www.brianstorti.com/understanding-shell-script-idiom-redirect/
add a comment |Â
up vote
3
down vote
accepted
The grep
command is just there to clean up the output for you. The hash checker checks against all the disk images, so the grep command keeps things simple.
With grep:
ubuntu-core-16-amd64.img.xz: OK
Without grep:
ubuntu-core-16-amd64.img.xz: OK
sha256sum: ubuntu-core-16-cm3.img.xz: No such file or directory
ubuntu-core-16-cm3.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard-410c.img.xz: No such file or directory
ubuntu-core-16-dragonboard-410c.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard.img.xz: No such file or directory
ubuntu-core-16-dragonboard.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-i386.img.xz: No such file or directory
ubuntu-core-16-i386.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi2.img.xz: No such file or directory
ubuntu-core-16-pi2.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi3.img.xz: No such file or directory
ubuntu-core-16-pi3.img.xz: FAILED open or read
sha256sum: WARNING: 6 listed files could not be read
Update:
Sorry, I missed the 2>&1
part of your question. That portion directs any error messages to the same place as the standard output messages. This page explains that quirky idiom: https://www.brianstorti.com/understanding-shell-script-idiom-redirect/
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
The grep
command is just there to clean up the output for you. The hash checker checks against all the disk images, so the grep command keeps things simple.
With grep:
ubuntu-core-16-amd64.img.xz: OK
Without grep:
ubuntu-core-16-amd64.img.xz: OK
sha256sum: ubuntu-core-16-cm3.img.xz: No such file or directory
ubuntu-core-16-cm3.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard-410c.img.xz: No such file or directory
ubuntu-core-16-dragonboard-410c.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard.img.xz: No such file or directory
ubuntu-core-16-dragonboard.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-i386.img.xz: No such file or directory
ubuntu-core-16-i386.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi2.img.xz: No such file or directory
ubuntu-core-16-pi2.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi3.img.xz: No such file or directory
ubuntu-core-16-pi3.img.xz: FAILED open or read
sha256sum: WARNING: 6 listed files could not be read
Update:
Sorry, I missed the 2>&1
part of your question. That portion directs any error messages to the same place as the standard output messages. This page explains that quirky idiom: https://www.brianstorti.com/understanding-shell-script-idiom-redirect/
The grep
command is just there to clean up the output for you. The hash checker checks against all the disk images, so the grep command keeps things simple.
With grep:
ubuntu-core-16-amd64.img.xz: OK
Without grep:
ubuntu-core-16-amd64.img.xz: OK
sha256sum: ubuntu-core-16-cm3.img.xz: No such file or directory
ubuntu-core-16-cm3.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard-410c.img.xz: No such file or directory
ubuntu-core-16-dragonboard-410c.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-dragonboard.img.xz: No such file or directory
ubuntu-core-16-dragonboard.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-i386.img.xz: No such file or directory
ubuntu-core-16-i386.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi2.img.xz: No such file or directory
ubuntu-core-16-pi2.img.xz: FAILED open or read
sha256sum: ubuntu-core-16-pi3.img.xz: No such file or directory
ubuntu-core-16-pi3.img.xz: FAILED open or read
sha256sum: WARNING: 6 listed files could not be read
Update:
Sorry, I missed the 2>&1
part of your question. That portion directs any error messages to the same place as the standard output messages. This page explains that quirky idiom: https://www.brianstorti.com/understanding-shell-script-idiom-redirect/
answered Sep 8 at 13:46
tsteiner
563
563
add a comment |Â
add a 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%2faskubuntu.com%2fquestions%2f1073360%2fshasums-and-grep-in-verifying-ubuntu-download%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
Related: What do these symbols âÂÂ$@âÂÂ>/dev/null 2>&1" after a command mean?
â steeldriver
Sep 8 at 13:44
The command is
sha256sum -c SHA256SUMS
;2>&1
is a shell redirection that combines the command's standard error stream2
with its standard output stream1
so that both are piped to thegrep
commandâ steeldriver
Sep 8 at 13:47