Delete all files except Delete all files except particular extension lets say bam find . -type f ! -name '*.bam*' -delete