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
目录
相关文章
|
11月前
|
自然语言处理 机器人 API
解锁电商直播新纪元:无人数字人客服如何在直播间掀起智能革命,重塑顾客服务体验的未来?
【10月更文挑战第7天】随着电商直播的兴起,客户咨询量激增,传统人工客服难以应对,无人数字人直播机器人客服应运而生。本文介绍如何使用Python、LangChain和ChatGPT搭建高效客服系统,包括安装库、设置API密钥、定义问答流程、构建FAQ知识库、集成实时聊天界面及部署上线,帮助企业自动处理客户咨询,提升用户体验。
399 2
|
11月前
|
存储 算法 数据管理
数据结构与算法学习二零:二叉排序树(BST)、平衡二叉树(AVL)
这篇文章通过需求分析、代码实现和测试验证,详细介绍了二叉排序树的创建、遍历和删除操作,以及二叉平衡树(AVL)的自平衡特性和单旋转操作,旨在提高树结构在数据管理中的效率和性能。
257 0
数据结构与算法学习二零:二叉排序树(BST)、平衡二叉树(AVL)
|
Linux 虚拟化
VMware虚拟机中Linux系统磁盘空间扩容实战
VMware虚拟机中Linux系统磁盘空间扩容实战
1156 0
|
PHP
PHP——oneinstack重新安装PHP的时候报错
PHP——oneinstack重新安装PHP的时候报错
153 4
|
分布式计算 Hadoop 大数据
数据工程师必须掌握的7个大数据实战项目
值得收藏,数据工程师必须掌握的7个大数据实战项目
8046 1
数据工程师必须掌握的7个大数据实战项目
|
数据采集 数据可视化 数据挖掘
Python数据分析中如何更好地进行数据可视化?
Python数据分析中如何更好地进行数据可视化?
199 0
|
并行计算 PyTorch Linux
pytorch安装GPU版本 (Cuda12.1)教程: Windows、Mac和Linux系统下GPU版PyTorch(CUDA 12.1)快速安装
pytorch安装GPU版本 (Cuda12.1)教程: Windows、Mac和Linux系统下GPU版PyTorch(CUDA 12.1)快速安装
10938 0
|
关系型数据库 MySQL 测试技术
|
存储 Kubernetes Cloud Native
彻底解决K8S节点本地存储被撑爆的问题1
彻底解决K8S节点本地存储被撑爆的问题1
305 0