
It took me some time to figure this one out, so I figured I would share this with everybody on the internet. I had a directory with a bunch of tgz files and I wanted to make a checksum on every single file without having to write a script, I always knew that the find command had an “exec” option, but I had problems with the redirection. After some trial-and-error, here is the command I used, it worked out perfectly!
find . -name “*.tgz” -exec sha256sum {} > checksums.sha256 \;
The results were a simple file that I could use to verify that I did indeed download the files off of my server without any corruption.
It took me some time to figure this one out, so I figured I would share this with everybody on the internet. I had a directory with a bunch of tgz files and I wanted to make a checksum on every single file without having to write a script, I always knew that the find command had an “exec” option, but I had problems with the redirection. After some trial-and-error, here is the command I used, it worked out perfectly!
find . -name “*.tgz” -exec sha256sum {} > checksums.sha256 \;
The results were a simple file that I could use to verify that I did indeed download the files off of my server without any corruption.