Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What I want but can't find:

$ download -url -md5
[================================================================>] 100%
md5check .... OK

But what I have to do with my current knowledge is this:

$ wget
$ md5sum
#use eyes for comparison

Is there any tool, that can do that for me? Or do I need to write a shell script for that?

share|improve this question

closed as off-topic by random Feb 25 at 4:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – random
If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

This should work just fine.

wget && wget && md5sum -c *.md5

this is less to type;

wget ftp://yourfile{.zip,.zip.md5} && md5sum -c *.md5

Wildcards are a bit much in a crowded download folder, so adjust to your needs.

share|improve this answer
the really critical part here, I guess would be the md5sum -c part of it? –  Journeyman Geek Nov 3 '12 at 12:24
essentially yes op (and I) wanted an automated solution. This just adds all the cmds together. if you already have the files then just the md5sum -c will work just fine –  wuxmedia Nov 3 '12 at 12:27

Updated some stuff, now it's working.

First download the file:

 wget http://source.tar.gz

Then download the md5sum of file.

 wget http://source.md5 -o source.tar.gz.md5

So it looks like this:

$ ls

Then: vi /bin/

[ ! -f "$key" ] && echo "sth done: There is no md5 file to check: $key" && exit
[ ! -f "${key%.*}" ] && echo "sth done: There is no source file to check: ${key%.*}" && exit
[ ! "${key##*.}" == "md5" ]  && echo "usage:$0 file.tar.gz.md5" && exit
mdsum=(`md5sum -- "${key%.*}"`);
mdsum_md5=(`head -n1 "$key"`);
[ "${mdsum}" == "" ] || [ "${mdsum_md5}" == "" ] && echo "Propably program error, check spaces or special characters in filenames. md5sum:"${mdsum}" file:"${mdsum_md5} && return;
if [ "${mdsum}" == "$mdsum_md5" ];
then echo "    done: CHECKED all ok"
else echo -e "    done: WARRNING MD5 sums are not equal!\t(${key})" && echo $mdsum && head -n1 "$key"


chmod 700

So I can

./ source.tar.gz.md5 
      done: CHECKED all ok

./ source.tar.gz.md5 
      done: WARRNING MD5 sums are not equal!      (source.tar.gz.md5)
      db21373e270b06c00dd3d2c89b95899a source.tar.gz

And where is the download part mentioned earlier?

wget http://source.tar.gz && wget http://source.md5 -o source.tar.gz.md5 && /bin/ source.tar.gz.md5

Now you can alias it:

this is wrong: alias md5dl="wget $1 && wget $2 -o $(basename $1).md5 && /bin/ $(basename $1).md5"

Still don't know, why aliases don't want to function like above, so if using bash vi .bash_profile and add:

function md5dl() {
wget $1 && wget $2 -o $(basename $1).md5 && /bin/ $(basename $1).md5

Reload profile source .bash_profile

And final move would be:


But in my opinion: better way is to (1st) download all the required files and (2nd) then compare, all types 'md5,asc,sign,sha1' at once in download directory. Even better would be monitor and auto check download folder for 'md5,asc,sign,sha1'.

share|improve this answer
shell aliases don't accept parameters ($1 etc), that's what functions are for. –  patrix Aug 4 '12 at 9:30
I always catch myself on this, but i think they don't accept parameters because of security reason. –  okobaka Aug 8 '12 at 13:23
No, but because of how they work. Basically an alias results in a text substitution of the alias with its 'value'. That's why alias ll=ls -l does the "right" thing when ll *.foo is called (which gets expanded to ls -l *.foo and afterwards executed). –  patrix Aug 8 '12 at 15:55

Unless my bash-fu failed me, this should work. You only have to have wget and curl. Save this as or similar, then run chmod +x on the file.

Now, run as:


This only works with the BSD md5 that comes with OS X:

wget "$1"
checksum=$(curl "$2")
if [ "$checksum" = $(md5 -q $(basename "$1")) ]
  echo "Checksum correct."
  echo "Checksum false."

Exchanging the if line should work for Linux – but I can't test it:

if [ "$checksum" = $(md5sum $(basename "$1") | cut -d ' ' -f 1) ]
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.