Languages
[Edit]
EN

Bash - calculate md5 sum in terminal

5 points
Created by:
Marcin
18610

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

Quick solution:

echo -n text | md5sum

# or:

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

Example output:

1cb251ec0d568de6a929b520c4aed8d1

Where -n removes new line 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

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