I often need to find a particular sequence in a fasta file and print it. For those who don\'t know, fasta is a text file format for biological sequences (DNA, proteins, etc.
Using the > as the record separator:
>
awk -v seq="sequence2" -v RS='>' '$1 == seq {print RS $0}' file
>sequence2 ACTGACTGACTGACTG ACTGACTGACTGACTG