grep -c "^>" fasta_file
and if the ”-” key is broken on your keyboard
grep "^>" fasta_file | wc
grep -c "^//$" genbank_file
seqret -sequence myfasta.fa -outseq myfasta2.fa
via What you're doing is rather desperate, more on seqret.