Sorry if this question has been asked before. I am new to all of this.
I would like to concatenate all files from different folders that contain
R1 at a specific position in their filenames. My attempts so far are not working as some file names have a different S number.
952_56890_S91_combined_L001_R1_001.fastq.gz 952_56890_S91_combined_L001_R2_001.fastq.gz 952_53929_S92_combined_L001_R1_001.fastq.gz 952_53929_S92_combined_L001_R2_001.fastq.gz
952_56890_S125_combined_L001_R1_001.fastq.gz 952_56890_S125_combined_L001_R2_001.fastq.gz 952_53929_S126_combined_L001_R1_001.fastq.gz 952_53929_S126_combined_L001_R2_001.fastq.gz