Search code examples
linuxfindmd5sum

Print md5sum of results of a find command in Linux


I am tryng to do checksum on all .jar files I can find in directory and its sub directories. Then print the filename with the checksum value to a file.

this is what I have.

md5sum | find -name *.jar >result.txt

I am trying to join two commands together that I know work individually.

Any help appreciated.


Solution

  • You could use something like this to execute a command on each file:

    find . -name "*.jar" -exec md5sum {} \; >result