Comparing hashes makes it possible to detect changes in files that would cause errors. The possibility of changes (errors) is proportional to the size of the file; the possibility of errors increase as the file becomes larger. It is a very good idea to run an SHA-256 hash comparison check when you have a file like an operating system install CD that has to be 100% correct.
Most Linux distributions come with the sha256sum utility (on Ubuntu it is part of the coreutils package). We are going to use the OpenSuSe 11.3 ISO file for the following example:
Check the iso file
First open a terminal and go to the correct directory to check a downloaded iso file:
Then run the following command from within the download directory.
sha256sum Linux.iso
sha256sum should then print out a single line after calculating the hash:
35ad366043bd80bbf5dcab5089f46a3efd142fd132b4423343f716ae0177fd86 Linux.iso
Compare the hash (the alphanumeric string on left) that your machine calculated with the corresponding hash in the SHA256SUMS file.
When both hashes match exactly then the downloaded file is almost certainly intact. If the hashes do not match, then there was a problem with either the download or a problem with the server. You should download the file again from either the same mirror, or from a different mirror if you suspect a server error.
Check here to know how to perform md5 checksum.
source:http://linuxpoison.blogspot.com/2010/09/13578167751578.html