I am trying to generate separate .md5 files for each .fastq file in a directory. I found solutions to generate a single .md5 file for many files, but this is not what I am looking for.
I have file1.fastq
, file2.fastq
, file3.fastq
and want to generate file1.md5
, file2.md5
, file3.md5
.
I assume that a FOR loop would do the trick but I am not a programmer and can't seem to find a solution to this problem.
I also tried the following code:
find . -type f -name "*.fastq.gz" -exec sh -c "md5sum < {} > {}.md5" \;
It correctly generates an .md5 file for each .fastq file, but the .md5 file contents are incorrect, i.e. I get 64399513b7d734ca90181b27a62134dc -
instead of 64399513b7d734ca90181b27a62134dc testfile.fastq
Can anyone help?
*fastq
or*fastq.gz
?