I am trying to find files and add their md5sum into a table.
find /store/01 -name "*.fits" -exec chmod -x+r {} \; -exec ls -l {} \; | tee ALL_FILES.LOG
How do I add in the ls -l output the md5sum of the file?
I would like to have it output the ls -l and an extra column of md5sum result
E.g.:
-rw-r--r-- 1 data user 221790 Jul 28 15:01 381dc9fc26082828ddbb46a5b8b55c03 myfile.fits
This one liner will do what do you want (edit the find search to fit your needs by adding the
/store/01 -name "*.fits" -exec chmod -x+r {} \;instead of the. -type fin my example):Example:
To get the output as you wanted, you can remove the field $8 as follows
HTH