eg: Why didn't you listen to the teacher but to disturb others...? Is this sentence correct?
I want to express sb. have done sth. he shoudn't do but not do sth. he should do.

Thank you.
"You didn't listen to your teacher, but disturbed others." is correct.

You could also say :
"Why didn't you listen to your teacher instead of disturbing others."

I'm not sure that's exactly what you're looking for, though.

Yes, that's just what I'm looking for. I have seen that before but I can't remember it. I'm now reminded with your help.