I want to delete the part starting after ">" until "cds_". And the characters after the accession. In the example "_1" and "_2".
In the original file this counts up to 784, so "_784". Can someone help me with a solution? Would be great.

From this

    >lcl|NC_002712.2_cds_NP_268424.1_1 [gene=dnaZA]
    ATGACTG
    >lcl|NC_002721.2_cds_NP_268453.1_2 [gene=dnaGC]
    ATGTTCG

To

    >NP_268424.1 [gene=dnaZA]
    ATGACTG
    >NP_268453.1 [gene=dnaGC]
    ATGTTCG
    cat $filename | sed 's/>.*cds_/>/'  | sed -e 's/_[0-9]* \[/ \[/'

*First sed*

Each character (.*) that is contained between `>` and `cds_` is replaced by only `>`. This leaves the FASTA header intact but removes everything until `NP_`. 

*Second sed*

Enabling regular expressions (`-e`) we substitute each combination of underscore (`_`), a series of numeric characters (`[0-9]*`), a whitespace (` `) and a bracket, escaped (` \[`) by a whitespace and an escaped bracket only (` \[`).