Meaning of “but” - Learner’s Dictionary

but

preposition uk us strong /bʌt/ weak /bət/

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)