Multi fasta to single fasta files $ perl -ne 'if (/^>(\S+)/) { close OUT; open OUT, ">$1.fasta" } print OUT' genome.fasta #Multi-fasta #fasta#multi#genome#files
#Convert a #multi-line #fasta to a #singleline#fasta $ awk '!/^>/ { printf "%s", $0; n = "\n" } /^>/ { print n $0; n = "" } END { printf "%s", n }' sample1.fa > sample1_singleline.fa