who, what, where, etc. 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.

who, what, where, etc. the ˈdevil...

(old-fashioned, informal) used in questions for showing that you are annoyed or surprised: Who the devil are you? Where the devil have I put my glasses?
Farlex Partner Idioms Dictionary
See also:
  • (in) the devil
  • the devil
  • What in the devil?
  • What the devil?
  • in creation
  • in creation?
  • in thunderation?
  • the blazes
  • in (the) blazes?
  • in blue blazes?