下载了个 Debian 的镜像,校验哈希 256 实操如下:
lsmscnm@localhost:~/下载> echo “1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158 debian-12.5.0-amd64-DVD-1.iso” > sum.txt ; sha256sum debian-12.5.0-amd64-DVD-1.iso >> sum.txt ; cat sum.txt
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158 debian-12.5.0-amd64-DVD-1.iso
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158 debian-12.5.0-amd64-DVD-1.iso
lsmscnm@localhost:~/下载> cat sum.txt |uniq
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158 debian-12.5.0-amd64-DVD-1.iso
以上是直接把从官网复制的校验值和镜像校验导入,这种情况成功过滤。
而这里没把官网上的文件名复制,所以手动用 VIM 删除了亲手校验出的文件名,但不知为何这种情况就无法过滤了。
lsmscnm@localhost:~/下载> echo 1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158 > test.txt ; sha256sum debian-12.5.0-amd64-DVD-1.iso >>test.txt
lsmscnm@localhost:~/下载> cat test.txt
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158 debian-12.5.0-amd64-DVD-1.iso
lsmscnm@localhost:~/下载> VIM test.txt
lsmscnm@localhost:~/下载> cat test.txt
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158
lsmscnm@localhost:~/下载> cat test.txt |uniq
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158
1e8037d1d208b4d6a2f4ff54cacc8df8f6e51ec326be8598661a1d9988839158
希望有人告诉我下我哪一步错了。