简体   繁体   中英

How to add cksum in find command

$ 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

After file name I have to display cksum of the file in the above find command. How to do it.

Thanks in advance.

Regards, Abu

find + cksum solution:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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