If you are a great fan of the Victorian novelist Charles Dickens, let me put your mind at rest by saying that the “dickens” that you find in the expression has nothing to do with the author. “What the dickens” has been around for over five centuries. In the old days, people refrained from using words like “hell”, “devil”, and “Satan” in their speech. They felt that if these words were uttered, their souls would immediately go to hell; as a result, they coined euphemisms for these words. “Dickens” was one of the words they came up with.
The expression “what the dickens” has the same meaning as “what the hell?” and “what the devil?” So when someone says, “Who the dickens are you?” what he is saying is, “Who the hell/devil are you?” According to some scholars “dickens” refers to Satan. One of the terms used to refer to the devil is “Old Nick”. Since “dick” rhymes with “Nick”, the word began to be used to refer to the devil. There are a number of expressions in the English language with the word “dickens”. Some are, “go to the dickens”, “raise the dickens”, “play the dickens” and “the dickens take you”.