I have a directory(INPUTDIR) with sample names as subdirectories(508_C,540_C,570_D etc).Within those each subdirectories there is another directory called FASTQ which contains two kinds of files.e.g.540_Ct_1.fastq.gz   540_Ct_2.fastq.gzI want to create two lists,the first having all _1.fastq.gz filenames with paths and the other having _2.fastq.gz filenames with paths.The directory structure is INPUT DIR > 508_C >FASTQ > 508_1.fastq.gz 508_2.fastq.gzINPUT DIR > 540_C >FASTQ > 540_Ct_1.fastq.gz 540_Ct_2.fastq.gzINPUT DIR > 570_D >FASTQ >570_Ct_1.fastq.gz 570_Ct_2.fastq.gzThe INPUTDIR is the main directory.I want to create TWO lists in this directory.One list has :/home/user/INPUT DIR > 508_C >FASTQ > 508_1.fastq.gz /home/user/INPUT DIR > 540_C >FASTQ > 540_Ct_1.fastq.gz /home/user/INPUT DIR > 570_D >FASTQ > 570_Ct_1.fastq.gz The second list has:/home/user/INPUT DIR > 508_C >FASTQ >508_2.fastq.gz/home/user/INPUT DIR > 540_C >FASTQ > 540_Ct_2.fastq.gz/home/user/INPUT DIR > 570_D >FASTQ >  570_Ct_2.fastq.gzThanks,Ron
Creating a list containing filenames with paths
linux;shell script;command line;directory structure;bioinformatics
cd INPUTDIRfind . -name \*1.fastq.gz > list1find . -name \*2.fastq.gz > list2The paths in the list files will be relative to the current directory. If you want absolute paths, usefind $PWD -name \*1.fastq.gz > list1