Hi.

I have a fasta file with multiple headers and want to get reverse complement sequences.
I usually use FASTX-TOOLKIT, but I want to learn how to do with linux commands.

I tried it using 'awk' and 'if' something like below, but I got a tedious result.

    awk '{if($1 ~ />/) print $0; else gsub("[ATCG]","[TAGC]");print $0}' TEST.fa


As you can see, the file has the same string in the header.

How can I get reverse complement sequences without altering the headers?

    > ATCG_1
    agtcgacATCGATtataggta
    > ATCG_2
    cgactgcagtcgacATCGACT


Thank you!

using '**tr**', and '**rev**', 2 lines per sequence 

     cat input.fa | while read L; do  echo $L; read L; echo "$L" | rev | tr "ATGC" "TACG" ; done