Get md5sum without file name?

md5sum < filename

This will give you an empty filename.


md5sum filename | awk '{print $1}'

That would be one way.


Also:

md5sum filename | cut -c -32

Which has the benefit of having no quotes or characters needing to be escaped, in case you need to embed that command someplace which might have multiple string interpreters acting on it.


Another way is to do :

md5sum filename |cut -f 1 -d " "

Cut will split line to each space and return only first field.