I have a protein motif or site, which I like to identify in an DNA sequence (multiple fasta file). The motif is N-X-S/T (X!=P), which means Asn, followed by any amino acid but not Pro, followed by Ser or Thr. Also X should not be STOP. So I would like to find all the 3 codon combinations for this site in DNA (9 nucleotides).

I was first thinking of getting the motif written in DNA using IUPAC coding, but that seemed not possible. Writing out all possibilities seems like a too hard task, so I thought there might be a tool which can do this? Any suggestions?
Haven't tried it, but you could do a 2-tiered grep-approach. Make sure your fasta is not line-wrapped.

    grep -o "AA[CT][ACGT]\{3\}\([AU]C[ACGT]|AG[CU]\)" fasta_file | grep -v "[ACGT]\{3\}CC[ACGT][ACGT]\{3\}".

Assuming `Asn = AAY = AA[CU]`, `Ser = UCN, AGY = UC[ACGT], AG[CU]`, `Thr = ACN = AC[ACGT]`, and `Pro = CCN = CC[ACGT]`,
the first part should match all peptides `N-X(traditional = all amino acids)-S/T`, the second should get rid off the ones that contain proline in the central position. I am not sure about whether you have to use an additional set of `\(\)` in the first expression.