仅使用md5sum获取哈希值(不带文件名) [英] Only get hash value using md5sum (without filename)

查看:737
本文介绍了仅使用md5sum获取哈希值(不带文件名)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用md5sum生成文件的哈希值. 但是我只需要接收哈希值,而不是文件名.

I use md5sum to generate a hash value for a file. But i only need to receive the hash value, not the file name.

md5=`md5sum ${my_iso_file}`
echo ${md5}

3abb17b66815bc7946cefe727737d295 ./iso/somefile.iso

3abb17b66815bc7946cefe727737d295 ./iso/somefile.iso

我如何剥离"文件名而仅保留其值?

How can i 'strip' the file name and only remain the value ?

推荐答案

另一种方式:)

md5=`md5sum ${my_iso_file} | awk '{ print $1 }'`

这篇关于仅使用md5sum获取哈希值(不带文件名)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆