Skip to content
Advertisement

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.

Advertisement

Answer

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

find . -name "*.jar" -exec md5sum {} ; >result
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement