I'm searching for a script which creates a md5 chechsum file for every single folder inside drive recursivley?
I do have a copy of md5deep on my machine but I'm not that good in scripting bash.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
To get a .md5 file for any files under a specific directory, you can use the following script:
#!/bin/bash if [ $# -ne 1 ] ; then echo "Usage $0 [directory]" exit 1 fi find $1 -type f -print0 | while IFS= read -r -d $'\0' file; do ( cd "$(dirname "$file")" filename="$(basename "$file")" md5sum "$filename" > "$filename".md5 ) done
zsh, the same for all files under the current directory can be done with the one-line command (includes files starting with a dot):
for i in **/*(/D) ; do ( cd $i ; for j in *(.D) ; do md5sum $j > $j.md5 ; done ) ; done