Skip to content

Instantly share code, notes, and snippets.

@ETiV
Last active December 17, 2015 05:39
Show Gist options
  • Save ETiV/5559407 to your computer and use it in GitHub Desktop.
Save ETiV/5559407 to your computer and use it in GitHub Desktop.
要点: find 的 -exec 可以出现很多次. 并依出现次序执行命令
#!/bin/sh
cd "$1"
#find * -type f -print0 | xargs -0 $DIR/digest.sh
find * -name "*" -type f -exec stat --printf='%s ' '{}' \; -exec md5sum '{}' \;
cd - > /dev/null
@ETiV
Copy link
Author

ETiV commented May 11, 2013

usage:
./build_md5.sh ${DIR_NAME}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment