Bash版本:3.5
我有两个最喜欢的命令,我使用了很多
这是我的代码
find . -type f -print0 | xargs -0 md5sum -b
find . -type f -print0 | xargs -0 stat -c "%y"
如何将它们组合起来并得到与我的期望相似的结果。
结果:
4d452a2b17f0a6ea9408f959ad7a28a35d67c810 2016-06-28 16:09:34.000000000 211 ./DEW-FILES_COPY_2016-06-28_16092425_.bat
答案 0 :(得分:5)
这样:
find . -type f -exec bash -c 'file={};m5s=$(md5sum -b $file|cut -d" " -f1);echo "$m5s "$(stat -c "%y" $file)" $file"' \;