I do have fastq files names like this:
Soil-53_R1_001.fastq
Root-29_S27_L001_R2_001.fastq
Soil-53_R2_001.fastq
Root-2_S35_L001_R1_001.fastq
Soil-54_R1_001.fastq
Root-2_S35_L001_R2_001.fastq
Soil-54_R2_001.fastq
and I want them all to compress in fastq.gz format, please suggest how I can do this with a single command.
31 Answer
gzip *.fastqwill create a compressed file for any file ending in .fastq
gzip -r {dir}will create a compressed file for any file found in {dir}.
(gzip itself never creates 1 file. You could use tar with the z option for compressing)