What the devil?

(in) the devil

Used as an intensifier after a question word (who, what, where, when, why, and how) to express extreme confusion, surprise, or aggravation. And just how the devil am I supposed to have three reports done by 9 AM tomorrow? Where in the devil did you find that rusty old car? Who the devil is making all that noise?
See also: devil
Farlex Dictionary of Idioms.

What (in) the devil?

 and What (in) the dickens?
Inf. What has happened?; What? (Often with the force of an exclamation.) What in the devil? Who put sugar in the salt shaker? What the dickens? Who are you? What are you doing in my room?
See also: what

What the devil?

 and What the fuck?; What the hell?; What the shit?
What has happened?; What? (Often with the force of an exclamation. What the fuck? and What the shit? are taboo.) What the devil? Who put sugar in the salt shaker? What the fuck? Who are you? What are you doing in my room? What the shit are you doing here? You're supposed to be at work.
See also: what
McGraw-Hill Dictionary of American Idioms and Phrasal Verbs.

What the devil?

verb
See What in the devil?
See also: what
McGraw-Hill's Dictionary of American Slang and Colloquial Expressions
See also:
  • (in) the devil
  • the devil
  • What in the devil?
  • in creation
  • in creation?
  • in thunderation?
  • the blazes
  • in (the) blazes?
  • in blue blazes?
  • what in tarnation