All but is a compound adverb that means almost or very nearly. Be aware that it is also used without being a compound adverb to meaning everything except.
Anything but is a compound phrase used to negate a trait in something or someone. It is used when one desires this negation to be emphasized. It is almost exclusively used with ‘to be’ verbs. Users should be aware that this can also be used without being a phrase, to mean all choices except.
A third variation that should be noted is everything but.
Everything but is literal in its definition, all except. In this way it is a synonym of all but when that phrase is not used as an adverb. However, everything but cannot be used to mean almost.
The Nigerian army said on Tuesday it had repelled Boko Haram from all but three local government districts in the northeast, claiming victory for its offensive against the Islamist insurgents less than two weeks before a presidential election. [Reuters]
A regulation victory by the Coyotes would all but guarantee a 30th-place finish for the Sabres and a top-two draft pick. [The Buffalo News]
The 5th Lexington Antique Show and Sale was anything but a washout, despite the constant drizzle and rain that tried to dampen the event on Friday and Saturday. [Lexington Leader]
Allowing kids to refuse a fruit/vegetable with their school meal is anything but common sense. [Huffington Post]
“We are open-minded about everything but now it’s up to them to approach us.” [Sydney Morning Herald]