Ubuntu – How to get the MD5 hash of a string directly in the terminal

command linemd5sum

How do I get the MD5 hash of a string directly from the terminal?

For example, I want the string abcdefg hashed. Currently the md5sum command only accepts a filename as input. I want to simply enter the following line and everything be done with.

md5sum abcdefg
output: ac54bcf346e578feb46888b3ecd2344f

How can I achieve that?

Best Answer

You can also say something like this :

~$ echo -n Welcome | md5sum
83218ac34c1834c26781fe4bde918ee4  -

It basically does the same thing as described by @enzotib, but is perhaps a bit simpler.

Related Question