File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Use of Checksum command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Use of Checksum command" Watch "Use of Checksum command" New topic

Use of Checksum command

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10031


What is the purpose of the sum command in Linux? I mean how could the contents of a file that I download differ in my local copy after downloading?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Two reasons I can think of. Sometimes the download fails. I have gotten downloads where they appeared to succeed, but where a sizable portion of the back end of the file is all hex zeros. Doing a checksum will spot such a failed download. Of course, you often find out about this when you attempt to unpack it.

The other possibility is that someone hacked the download link and you end up downloading something other than what you expected. A checksum will help you identify such fraudulent downloads.

JBoss In Action
Pat Farrell

Joined: Aug 11, 2007
Posts: 4659

It has more general uses as well. You could run it periodically against your critical config files to detect any adjustments or hacks to your system.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10031

Though not fully convincing on the Checksum utility, I feel it to some extent meaningful.
I agree. Here's the link:
subject: Use of Checksum command
It's not a secret anymore!