compress all fastq files to fastq.gz

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.

3

1 Answer

gzip *.fastq

will 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)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like