Nick Rout wrote:

on a linux box you rin, for example the command,

[EMAIL PROTECTED] gentoo $ md5sum gensmall.iso
b2c244923a0ddf4b266fb2bf665f65ac  gensmall.iso

the number starting b2c244... is the mdksum of the file gensmall.iso.

Just for the record, the "number" has letters in because it is in hexadecimal, i.e. base 16, not base 10 like what we usually think. Computers like to do things in powers of two. Base 10 is just too arbitrary and needlessly complex.


Just in case you want the above in decimal, here's what I copied from my shell:

>bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
ibase=16
B2C244923A0DDF4B266FB2BF665F65AC
237611279629402458412288808543663908268


The line ibase=16 sets the input base. (use obase for output - defaults to 10)


Tip: I noticed bc doesn't like lower case hex. After I selected nick's md5sum, and pasted it into the input of bc, Ctrl-A goes to the start of line, then Alt-U to up-case the entire word. This works in normal (bash) shell prompts as well as in bc (and emacs too, of course!).

Todays CLI tip,
Carl.

Reply via email to