#Oneliner to convert awk '/^>/ {printf("\n%s\n",$0);next; } { printf("%s",$0);} END {printf("\n");}' < file.fa > fileres.fa #Then delete the first empty line tail -n +2 fileres.fa > fileout.fa