Languages
[Edit]
EN

Bash - calculate md5 sum in terminal

5 points
Created by:
Khloe-Kaiser
578

In this short article, we would like to show how to calculate md5 sum in Bash for a given string.

Quick solution:

echo -n text | md5sum

# or:

echo -n 'Some text with spaces here ...' | md5sum

Example output:

1cb251ec0d568de6a929b520c4aed8d1

Where -n removes ending newline character from the echo output.

 

Alternative examples

From string:

md5sum <<< 'Some text here ...'

From file:

md5sum < /path/to/file.txt

From command:

some_command | md5sum

 

Alternative titles

  1. Bash - calculate md5 hash in terminal
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - calculate md5 sum in terminal
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join