Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

md5suming a file is fine, but I cannot seem to invoke md5sum to calculate the hash based only on the file's contents. (For those wondering, I'd prefer that multiple wgets of the same file return the same md5 hash. md5summing the file keeps reporting different hashes because the timestamp on the file is different.)

julian@julian-computer:/tmp$ md5sum < `cat index.html`
bash: `cat index.html`: ambiguous redirect
share|improve this question
md5sum index.html, md5sum < index.html, cat index.html | md5sum, md5sum < <(cat index.htm) and md5sum <<< "$(< index.html)" all calculates MD5 hash of the file's content. If you get different MD5 hashes for the same file downloaded multiple times, then there are differences in their content. Show some exact URLs so we can prove it to you. (Note that the .html extension does not mean the file is static. PHP or other interpreters can also parse files with .html extension, or the web server may rewrite the requested URL internally.) – manatwork Oct 6 '11 at 16:59
Hi manatwork. Confirmed, I was just using md5sum incorrectly. Thanks. – Julian H. Lam Oct 6 '11 at 17:18
up vote 2 down vote accepted

Md5sum and other hashing functions have nothing to do with the timestamp of the file for which the checksum is being calculated. Unless you have some weird version installed it processes only the contents of the file.

share|improve this answer

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.