繁体   English   中英

如何将2个bash命令与print0结合使用

[英]How to combine 2 bash commands with print0 included

Bash版本:3.5

我有2个最喜欢的命令,我经常使用

这是我的代码

  1. find . -type f -print0 | xargs -0 md5sum -b

  2. 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

这条路:

find . -type f -exec bash -c 'file={};m5s=$(md5sum -b  $file|cut -d" " -f1);echo "$m5s "$(stat -c "%y" $file)" $file"' \;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM