Everyone but me was tired.(代词)
Finally,we had packed everything but the typewriter.(名词)
The car is anything but slow.(形容词)
Put it anywhere but on the floor.(介词短语)
We had no choice but to obey him.(不定式短语)
We know nothing of our new neighbour but that he was a Cambridge graduate.(从句)
注意：在do nothing but和there is nothing to do but后面的不定式通常省略to。
These women there did nothing but complain.
There was nothing to do but wait until he came back.
Everyone had a good time but John.(介词)The students had a good time but not John/but John did not.(连词)