md5 whole folder on macOS®

1970 + 1654469201

Single use

find -s /path/folder -type f -exec md5 -q {} \; | md5

# ignore ".DS_Store" files:
find -s /path/folder -type f ! -name .DS_Store -exec md5 -q {} \; | md5

# ignore multiple files:
find -s $1 -type f ! \( -name ".DS_Store" -o -name "MD5" -o -name "MD5.txt" \) -exec md5 -q {} \; | md5

Create script file (filename "md5dir", located in "~/.ilovescripts")

#!/bin/zsh

find -s $1 -type f ! -name .DS_Store -exec md5 -q {} \; | md5

Make script executable by "md5dir"

# Make script executable by user:
chmod u+x md5dir

# Create ".zshrc" inside "~/" folder:
export PATH="$PATH:$HOME/.ilovescripts"

# Restart Terminal and check paths:
echo $PATH

# Use script by running:
md5dir /path/folder

More posts