I'm trying to run samtools sort in a folder containing about 380 bam files.

I've tried the following command and nothing happens. No errors, it just returns blank. Can anyone help me with what I've done wrong? Thank you :)

    samtools sort -@ 7 *.bam > *.sorted.bam 


Try this;

    for f in *.bam; do filename="${f%%.*}"; samtools sort -@ 7 $f ${filename}.sorted.bam; done

Or

    for f in *.bam; do  samtools sort -@ 7 $f   ${f/.bam/sorted.bam}; done

