Meaning of “but” - Learner’s Dictionary

but

preposition us uk strong /bʌt/ weak /bət/
Extra Examples
I'll eat anything but celery.We can't do anything but wait and see.Everyone but Charlie was there.She's invited everyone but me.She does nothing but complain.

B1 except:

Everyone but Andrew knows.
Can you buy me a sandwich? Anything but ham.
This is the last programme but one (= the programme before the last).

(Definition of “but preposition” from the Cambridge Learner’s Dictionary © Cambridge University Press)