I do find some similar questions, but I don't know how to apply the answers to solve my problem.
I guess it's very simple to everyone here.
I have a fast file containing 2000+ sequences with headers like:
>VFG0001 fhaB filamentous hemagglutinin/adhesin [FHA] [Bordetella pertussis]
the content in the last [ ] is the bacteria name.
Also for some other sequences, the header is like
>VFG2304 misL putative autotransporter [MisL] [Salmonella enterica (serovar typhimurium)]
So I just want to extract sequences that have headers containing key word [Escherichia coli].
I also want to extract sequences that have headers containing key word [Salmonella enterica] ( I don't care about server within ()) into a separate fasta file.
How can I simply do this on Mac server ( maybe not use python or perl, just simple script)?