Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to get the md5 sum of a file on AIX, but the md5sum program prints the sum followed by the name of the file.

How can I get the sum without the file name.

share|improve this question
How are you getting the md5 computation? –  Chris Nov 5 '10 at 14:01
nix or windows? –  hbdgaf Nov 5 '10 at 14:07
@Chris md5sum, as noted. –  C. Ross Nov 5 '10 at 14:28
@aking1012 nix, I don't know how I forgot that. –  C. Ross Nov 5 '10 at 14:29
then gencha's answer should be sufficient...you can use any number of tools to split fields - awk, cut, whatever –  hbdgaf Nov 5 '10 at 14:54
show 1 more comment

2 Answers

up vote 3 down vote accepted
md5sum < filename

This will give you an empty filename.

share|improve this answer
That outputs a - to represent stdin. –  Dennis Williamson Nov 5 '10 at 15:53
This is what i use. Don't need cat though, just redirect md5sum < filename –  Rich Homolka Nov 5 '10 at 16:53
Good point @Rich, I do like that better –  heavyd Nov 5 '10 at 18:58
add comment
md5sum filename | awk '{print $1}'

That would be one way.

share|improve this answer
That is what I was thinking, just was not sure how he was getting the md5 in the first place. –  Chris Nov 5 '10 at 14:03
@Chris I figured this was the way as he mentioned the md5sum program. –  Oliver Salzburg Nov 5 '10 at 14:05
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.