Checksum on string

Sharon picture Sharon · Aug 28, 2011 · Viewed 17.7k times · Source

Is there a way to calculate a checksum on a string in Linux? The checksum commands that I have seen (cksum, md5sum, sha1sum, etc.) all require a file as input and I do not have a file. I only have a path to a location and want to calculate the checksum on that path.

Answer

ashiaka picture ashiaka · Aug 28, 2011
echo -n 'exampleString' | md5sum

should work.