check sha256sum value consistent with the reference value

简介: sha256sum;

how to check sha256sum value consistent with the reference value of the files downloaded( or copied) from somewhere ?

1. usage of the command sha256sum
Usage: sha256sum [OPTION]... [FILE]...
Print or check SHA256 (256-bit) checksums.
With no FILE, or when FILE is -, read standard input.

  -b, --binary         read in binary mode
  -c, --check          read SHA256 sums from the FILEs and check them
      --tag            create a BSD-style checksum
  -t, --text           read in text mode (default)
  Note: There is no difference between binary and text mode option on GNU system.

The following four options are useful only when verifying checksums:
      --quiet          don't print OK for each successfully verified file
      --status         don't output anything, status code shows success
      --strict         exit non-zero for improperly formatted checksum lines
  -w, --warn           warn about improperly formatted checksum lines

      --help     display this help and exit
      --version  output version information and exit

The sums are computed as described in FIPS-180-2.  When checking, the input
should be a former output of this program.  The default mode is to print
a line with checksum, a character indicating input mode ('*' for binary,
space for text), and name for each FILE.

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
For complete documentation, run: info coreutils 'sha256sum invocation'

2. An Example

[biocodee@localhost Downloads]$ ls -al
total 136640
drwxr-xr-x.  2 biocodee biocodee       231 Dec 25 09:44 .
drwx------. 16 biocodee biocodee      4096 Dec 25 07:53 ..
-rw-r--r--.  1 biocodee biocodee     40212 Dec 20 11:16 container-selinux-2.107-3.el7.noarch.rpm
-rw-r--r--.  1 biocodee biocodee  36243572 Dec 20 10:55 docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm
-rw-rw-r--.  1 biocodee biocodee 103553755 Dec 25 07:12 Miniconda3-py38_4.10.3-Linux-x86_64.sh
-rw-rw-r--.  1 biocodee biocodee        65 Dec 25 07:53 Miniconda3-py38_4.10.3.sha256
-rw-r--r--.  1 biocodee biocodee     69596 Dec 20 11:23 pigz-2.3.3-1.el7.centos.x86_64.rpm
[biocodee@localhost Downloads]$ echo "$(cat Miniconda3-py38_4.10.3.sha256) Miniconda3-py38_4.10.3-Linux-x86_64.sh" | sha256sum --check 
Miniconda3-py38_4.10.3-Linux-x86_64.sh: OK
[biocodee@localhost Downloads]$ echo "$(cat Miniconda3-py38_4.10.3.sha256) container-selinux-2.107-3.el7.noarch.rpm" | sha256sum --check 
container-selinux-2.107-3.el7.noarch.rpm: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match
[biocodee@localhost Downloads]$ cat Miniconda3-py38_4.10.3.sha256 
935d72deb16e42739d69644977290395561b7a6db059b316958d97939e9bdf3d
[biocodee@localhost Downloads]$ echo "935d72deb16e42739d69644977290395561b7a6db059b316958d97939e9bdf3d Miniconda3-py38_4.10.3-Linux-x86_64.sh" | sha256sum --check 
Miniconda3-py38_4.10.3-Linux-x86_64.sh: OK
目录
相关文章
CF1550B Maximum Cost Deletion(分段比较)
CF1550B Maximum Cost Deletion(分段比较)
40 0
|
TensorFlow 算法框架/工具
成功解决To fix this you could try to: 1. loosen the range of package versions you‘ve specified ​​​​​​​
成功解决To fix this you could try to: 1. loosen the range of package versions you‘ve specified ​​​​​​​
成功解决To fix this you could try to: 1. loosen the range of package versions you‘ve specified ​​​​​​​
MGA (Managed Global Area) Reference Note (Doc ID 2638904.1)
MGA (Managed Global Area) Reference Note (Doc ID 2638904.1)
323 0
SAP WM Storage Type Capacity Check Method 5 (Usage check based on SUT)
SAP WM Storage Type Capacity Check Method 5 (Usage check based on SUT)
SAP WM Storage Type Capacity Check Method 5 (Usage check based on SUT)
SAP WM中阶Storage Type的Capacity Check – Check based on maximum quantity per bin in storage type.
SAP WM中阶Storage Type的Capacity Check – Check based on maximum quantity per bin in storage type.
SAP WM中阶Storage Type的Capacity Check – Check based on maximum quantity per bin in storage type.
|
C++
PAT (Advanced Level) Practice - 1038 Recover the Smallest Number(30 分)
PAT (Advanced Level) Practice - 1038 Recover the Smallest Number(30 分)
124 0
PAT (Advanced Level) Practice - 1145 Hashing - Average Search Time(25 分)
PAT (Advanced Level) Practice - 1145 Hashing - Average Search Time(25 分)
119 0
[20180301]FORCE_MATCHING_SIGNATURE的计算
[20180301]FORCE_MATCHING_SIGNATURE的计算.txt --//链接的讨论,http://www.itpub.net/thread-2097379-1-1.
1199 0