
Terminal - Commands using md5sum - 42 results
find -iname "MyCProgram.c" -exec md5sum {} \;
This is sample output - yours may be different.
md5sum filename | ncat hash.cymru.com 43
This is sample output - yours may be different.
cat /var/lib/dpkg/info/*.md5sums|grep usr/sbin/sshd|sed 's,usr,/usr,'|md5sum -c
This is sample output - yours may be different.
Replace "user/sbin/sshd" with the file you would like to check. If you are doing this due to intrusion, you obviously would want to check size, last modification date and md5 of the md5sum application itself. Also, note that "/var/lib/dpkg/info/*.md5sums" files might have been tampered with themselves. Neither to say, this is a useful command.
dpkg-query -Wf '${Package}\n' | xargs dpkg --status | sed '/^Conffiles:/,/^Description:/!d;//d' | awk '{print $2 " " $1}' | md5sum -c 2>/dev/null | grep FAILED$ | cut -f1 -d':'
This is sample output - yours may be different.
$ dpkg-query -Wf '${Package}\n' | xargs dpkg --status | sed '/^Conffiles:/,/^Description:/!d;//d' | awk '{print $2 " " $1}' | md5sum -c 2>/dev/null | grep FAILED$ | cut -f1 -d':'
/etc/apt-fast.conf
/etc/xdg/autostart/at-spi-dbus-bus.desktop
/etc/bash.bashrc
/etc/chromium-browser/default
/etc/gnome/defaults.list
/etc/fuse.conf
/etc/xdg/autostart/gsettings-data-convert.desktop
/etc/xdg/autostart/bluetooth-applet-unity.desktop
/etc/xdg/autostart/bluetooth-applet.desktop
/etc/xdg/autostart/gnome-keyring-gpg.desktop
/etc/xdg/autostart/gnome-keyring-ssh.desktop
/etc/xdg/autostart/gnome-keyring-secrets.desktop
/etc/xdg/autostart/gnome-keyring-pkcs11.desktop
/etc/init.d/networking
/etc/dhcp/dhclient.conf
/etc/xdg/autostart/jockey-gtk.desktop
/etc/logrotate.conf
/etc/mdm/mdm.conf
/etc/mime.types
/etc/modprobe.d/blacklist.conf
/etc/xdg/autostart/nemo-autostart.desktop
/etc/NetworkManager/NetworkManager.conf
/etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop
/etc/sysctl.conf
/etc/xdg/autostart/pulseaudio.desktop
/etc/sudoers
/etc/xdg/autostart/print-applet.desktop
This functionality seems to be missing from commands like dpkg. Ideally, I want to duplicate the behavior of rpm --verify, but it seems difficult to do this in one relatively short command pipeline.
find-duplicates () { find "$@" -not -empty -type f -printf "%s\0" | sort -rnz | uniq -dz | xargs -0 -I{} -n1 find "$@" -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate; }
This is sample output - yours may be different.
This is a modified version of the OP, wrapped into a bash function.
This version handles newlines and other whitespace correctly, the original has problems with the thankfully rare case of newlines in the file names.
It also allows checking an arbitrary number of directories against each other, which is nice when the directories that you think might have duplicates don't have a convenient common ancestor directory.
echo http://www.TheWebSiteName.com privatekeyword | md5sum | awk '{print substr($0,0,10)}'
This is sample output - yours may be different.
$ echo http://www.TheWebSiteName.com privatekeyword | md5sum | awk '{print substr($0,0,10)}'
3ac2dd2389
Create a bash function for easy reference
webPassword()
{
echo $1 $2 | md5sum | awk '{print substr($0,0,10)}'
}
alias webpwd=webPassword
Use like this.
webpwd www.commandlinefu.com MyPetNameHere
echo -n 'the_password' | md5sum -
This is sample output - yours may be different.
find . -type f -print0 | xargs -0 -n1 md5sum | sort -k 1,32 | uniq -w 32 -d --all-repeated=separate | sed -e 's/^[0-9a-f]*\ *//;'
This is sample output - yours may be different.
md5sum<<<'text to be encrypted'
This is sample output - yours may be different.
Here Strings / A variant of here documents, the format is:
(from bash manpage)
read -s pass; echo $pass | md5sum | base64 | cut -c -16
This is sample output - yours may be different.
Why remember? Generate!
Up to 48 chars, works on any unix-like system (NB: BSD use md5 instead of md5sum)
IFS=$'\n' && for f in `find . -type f -exec md5sum "{}" \;`; do echo $f | sed -r 's/^[^ ]+/Checking:/'; echo $f | cut -f1 -d' ' | netcat hash.cymru.com 43 ; done
This is sample output - yours may be different.
Checking: ./yffix3Qs.zip
d95a72eb35820cc1dc3d750b53090b78 1318649640 NO_DATA
Checking: ./B_Malware_210911/soft.exe
52ca815d29da154fc1dff687505feab3 1318649641 NO_DATA
Checking: ./B_Malware_210911/sistem_nod.exe
6325547dd016d2e47e258396dc695ed7 1316696641 18
Checking: ./B_Malware_210911/yabotovrot.exe
33b76caf40a7ac013fded283b0f87c1e 1317442076 39
Checking: ./cat
332fc925297433af694c835afb8609f7 1318649646 NO_DATA
Checking: ./alot_symbolleiste_lexika_installer.exe
7cf02c378e195a85f586bbb83f7f4660 1318649647 NO_DATA
Command makes use of the Malware Hash Registry (http://www.team-cymru.org/Services/MHR/).
It parses the current directory and subdirectories and calculates the md5 hash of the files, then prints the name and sends the hash to the MHR for a lookup in their database.
The 3rd value in the result is the detection percentage across a mix of AV packages.
head /dev/urandom | md5sum | base64
This is sample output - yours may be different.
MAC=$((date +'%Y%m%d%H%M%S%N'; cat /proc/interrupts) | md5sum | sed -r 's/(..)/\1:/g' | cut -d: -f 1-6)
This is sample output - yours may be different.
I liked vaporub's suggestion, here a little simplification of the sed command.
for i in $(find . -name *md5checksum_file* | sed 's/\(\.\/.*\)md5checksum_file.txt/\1/'); do cd "$i"; md5sum -c "md5checksum_file.txt"; cd -; done | tee ~/checksum_results.txt | grep -v "<current directory>"
This is sample output - yours may be different.
extracts path to each md5 checksum file, then, for each path, cd to it, check the md5sum, then cd - to toggle back to the starting directory. greps at the end to remove cd chattering on about the current directory.
echo -n "String to MD5" | md5sum | sed -e 's/../& /g' -e 's/ -//'
This is sample output - yours may be different.
23 e4 a2 a9 d1 c1 25 73 3a 2e 6b 79 7f 7f 54 ef
Same result with simpler regular expression..
echo -n "String to MD5" | md5sum | cut -b-32
This is sample output - yours may be different.
echo -n "String to MD5" | md5sum | sed -e 's/[0-9a-f]\{2\}/& /g' -e 's/ -//'
This is sample output - yours may be different.
23 e4 a2 a9 d1 c1 25 73 3a 2e 6b 79 7f 7f 54 ef
Generates the md5 hash, without the trailing " -" and with the output "broken" into pairs of hexs.
echo -n "String to MD5" | md5sum | cut -f1 -d' '
This is sample output - yours may be different.
23e4a2a9d1c125733a2e6b797f7f54ef
Nothing special about hashing here, only the use of cut, I think, could result at fewer keystrokes.
echo -n "String to MD5" | md5sum | awk '{print $1}'
This is sample output - yours may be different.
echo -n "String to get MD5" | md5sum | sed "s/ -//"
This is sample output - yours may be different.
tar -cvf - $DIR_TO_BACKUP | tee >(md5sum > backup_md5.txt) > /dev/st0 && mt -f /dev/nst0 bsfm 1 && md5sum -c backup_md5.txt < /dev/st0
This is sample output - yours may be different.
Backups $DIR_TO_BACKUP into tape, creating on the fly a MD5SUM file of the backup.
Then rewinds one record on tape and checks if it's well written.
diff <(md5sum render_pack.zip| cut -d " " -f 1) <(md5sum /media/green/render_pack.zip| cut -d " " -f 1);echo $?
This is sample output - yours may be different.
0 #well done!
1 #so much trouble...
I had the problem that the Md5 Sum of a file changed after copying it to my external disk.
This unhandy command helped me to fix the problem.
diff -ua <(w3m -dump http://www.php.net/downloads.php|fgrep -A1 '5.2.15 (tar.bz2)'|awk '/md5:/{print $2}') <(md5sum php-5.2.15.tar.bz2|awk '{print $1}')
This is sample output - yours may be different.
Use zsh process substitution syntax.
This is sample output - yours may be different.
od -An -N10 -x /dev/random | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'
This is sample output - yours may be different.