如何在find命令中添加cksum

时间:2018-02-26 15:53:34

标签: linux find checksum

$ cksum sample.txt
2763733609 1659 sample.txt

$ find /usr/local/sqoop -printf '%i,%b,%M,%n,%u,%g,%s,%Tc,%h/%f'$'\n'
19404466,8,-rwxr-xr-x,1,hduser,hduser,1345,Monday 27 April 2015 12:12:36 PM IST,/usr/local/sqoop/conf/sqoop-env-template.sh

文件名后,我必须在上面的cksum命令中显示文件的find。 怎么做。

提前致谢。

此致 阿布

1 个答案:

答案 0 :(得分:0)

find + cksum 解决方案:

find /usr/local/sqoop -type f -printf '%i,%b,%M,%n,%u,%g,%s,%Tc,%h/%f,' \
-exec sh -c 'cksum {} | cut -d" " -f1' \;