bash 版本:3.5
我有 2 个最喜欢的命令,我经常使用它们
这是我的代码
找到 . -类型 f -print0 | xargs -0 md5sum -b
找到 . -类型 f -print0 | xargs -0 stat -c "%y"
如何将它们结合起来并得到与我下面的预期相似的结果。
结果:
4d452a2b17f0a6ea9408f959ad7a28a35d67c810 2016-06-28 16:09:34.000000000 211 ./DEW-FILES_COPY_2016-06-28_16092425_.bat
最佳答案
这样:
find . -type f -exec bash -c 'file={};m5s=$(md5sum -b $file|cut -d" " -f1);echo "$m5s "$(stat -c "%y" $file)" $file"' \;
关于linux - 如何将 2 个 bash 命令与包含的 print0 结合起来,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38199676/