Is there anything like HashTab for Linux?

5

1

I've recently installed Linux, and I know that you can use "md5sum filename" in terminal, but on Windows there is an AMAZING software called HashTab that incorporates it into the shell.

Its awesome, you just right click a file, it gives you the md5, crc32, and sha-1, and it provides a box where you can copy the actual md5 and it compares it for you. I think this program is ingenious, and I hope there is an alternative for linux. Does anyone know of one?

GiH

Posted 2009-11-14T06:54:52.370

Reputation: 3 667

+1 for explaining what it does, and not assuming everybody will know it. – user unknown – 2011-06-21T22:44:52.023

Which desktop environment (or really, which file manager) are you using? – David Z – 2009-11-14T08:36:34.020

Gnome and nautilus – GiH – 2009-11-14T17:27:51.793

Answers

4

As a former Windows XP user I got used to the Hashtab-tool in the Windows Explorer properties window. In search of an Ubuntu GNU Linux equivalent of this handy Hastab-tool I recently stumbled across a great hastab tool called "GtkHash" for Ubuntu GNU Linux (just search for "GtkHash" in the "Ubuntu Software Center").

Installation of "GtkHash" in Ubuntu 10.10 Maverick Meerkat takes only a few seconds and afterwards the tool can be found under:

  • Applications
    • Accessories
      • GtkHash

GtkHash supports hash functions like:

  • MD5
  • SHA1
  • SHA256
  • SHA512
  • RIPEMD
  • HAVAL
  • TIGER
  • WHIRLPOOL
  • and others.

I personally find "GtkHash" to be the best substitute for the hashtab-tool experience I had back in my Windows XP days for Ubuntu GNU Linux.

Greetings to all linux users worldwide! :)

don colon

Posted 2009-11-14T06:54:52.370

Reputation: 56

thanks, supercheetah's answer was the best solution, but this is much simpler – GiH – 2011-06-21T21:09:49.723

7

This is the next best thing, I think. Put the following code into $HOME/.gnome2/nautilus-scripts:

#!/bin/sh
# Released into the public domain.
#
for arg
do

md5=$(md5sum "$arg" | awk '{print $1}')
sha1=$(sha1sum "$arg" | awk '{print $1}')
crc32=$(crc32 "$arg")

  gdialog --title "Hashes" --msgbox "File $arg\nmd5   $md5\nsha1  $sha1\ncrc32 $crc32" 800 1100

done

I called the file hashes, but you can call it whatever you want. Make sure to set the execute permission (e.g. chmod +x hashes).

Here's the second part I promised:

#!/bin/sh
# Released into the public domain.
#
for arg
do

md5=$(md5sum "$arg" | awk '{print $1}')
md5compare=$(gdialog --title "MD5 comparison" --inputbox "MD5 hash to compare:" 200 3>&1 1>&2 2>&3)

if [ "$md5compare" = "$md5" ]; then
    gdialog --title "Match" --msgbox "Match confirmed" 200 200
else
    gdialog --title "No match" --msgbox "No match" 200 200
fi

done

This second script I called compare hashes.

EDIT: This is the final version. This one does both the hashes, and comparison with a while loop so that more than one comparison can be done.

#!/bin/sh
# Released into the public domain.
#
for arg
do
    md5=$(md5sum "$arg" | awk '{print $1}')
    sha1=$(sha1sum "$arg" | awk '{print $1}')
    crc32=$(crc32 "$arg")
    compare_msg="MD5 hash to compare:"
    md5compare=$(gdialog --title "Hashes and MD5 comparison" --inputbox "File $arg\nmd5\t\t$md5\nsha1\t\t$sha1\ncrc32\t$crc32\n\n$compare_msg" 1100 3>&1 1>&2 2>&3 )
    while [ $? -eq 0 ]
    do
        if [ "$md5compare" = "$md5" ]; then
            compare_msg="Match confirmed"
        else
            compare_msg="No match\n\t\t$md5compare"
        fi
        md5compare=$(gdialog --title "Hashes and MD5 comparison" --inputbox "File $arg\nmd5\t\t$md5\nsha1\t\t$sha1\ncrc32\t$crc32\n\n$compare_msg" 1100 3>&1 1>&2 2>&3 )
    done
done

This final version I called hash and compare.

EDIT: I just added some formatting niceties.

EDIT: I figured out how to avoid using a temporary file.

supercheetah

Posted 2009-11-14T06:54:52.370

Reputation: 836

Oh, I guess you also wanted it to compare stuff. Shouldn't be too hard to extend the script, but I'll have to do that later. – supercheetah – 2009-11-15T14:21:16.417

I just realized that I think I could combine the two into one script. I'll do that in a bit. – supercheetah – 2009-11-16T02:45:16.373

You're awesome! My only complaint is the interface is very primitive, but you made it work :-) – GiH – 2009-11-16T19:35:23.260

It would probably look better with zenity, but that's not always installed, and I know that gdialog is available anywhere gnome is installed. – supercheetah – 2009-11-17T02:28:14.477

3

I've always liked the handy, script-able md5sum command.
However, there appears to be a Java version called JSummer at Sourceforge.
Maybe, it will work for you.

nik

Posted 2009-11-14T06:54:52.370

Reputation: 50 788