How zip up a folder of loose FASTQ files
Posted on July 16, 2020

The problem is to find all fastq files, and submit each one, one by one as a job to be gzipped.
Local machine
ls *.fastq | xargs -I {} gzip {}
Multicore version
You will need to have pigz installed.
ls *.fastq | xargs -I {} pigz {}
Compute cluster - HPC
This really applies if you are working on a computing cluster (SLURM).
ls *.fastq | xargs -I {} sbatch --wrap="gzip {}"
Multicore version
You will need to have pigz installed.
ls *.fastq | xargs -I {} sbatch --wrap="pigz {}"