Split fasta file into files with one contig per file

csplit does this quite neatly:

csplit -z myfile.fas '/>/' '{*}'

Default output filename is xxNN (where NN is a integer). you can use something other than xx by specifying a prefix with –prefix=PREFIX.

Note, this command assumes that the contig title don’t contain a > except for at the start of the line. You can probably do something like ‘\n>’ or ‘^>’ to insure it must occur at the start of the line.