I have a directory with 94 subdirectories, each containing one or two files *.fastq. I need to apply the same python command to each of these files and produce a new file qc_*.fastq.
I know how to apply a bash script individually to each file, but I'm wondering if there is a way to write a bash script to apply the command to all the files at once
Use find:
.: The top-most directory-type f: Only files-iname "*.fastq": File name ends in.fastq(case insensitive)-exec python script: The command you want to execute.