In fantastic litterature, we often see a demon's true name holding a lot of power over him, is there any basis for this in historical belief?

by Poulposaurus
itsallfolklore

The importance of names in folklore and belief can be found in international examples (which is not to say that it is necessarily universal). A famous European example occurs in the widespread folktale, Aarne-Thompson-Uther 500, "The Name of the helper (Titeliture, Rumpelstiltzchen, Tom-Tit-Tot)." In this folktale, a supernatural entity undertakes an impossible task for a young woman provided that she give him something in return - often her firstborn child. The bargain would also be satisfied if she could guess the name of the dangerous creature.

Although folktales were told as fiction for entertainment (unlike legends), the popularity of this story underscores and rests upon the widespread underpinning belief, that names could have extraordinary effect on many things including supernatural entities. This is echoed in linguistics where we find circumlocutions for many things: Northern European elves are referred to as mound dwellers, the hidden people, good neighbors, and many other terms, because people believed it was impolite if not dangerous to name them directly. Even the word "elf" appears to be a circumlocution, although the word's origin and meaning are not clearly understood. Similarly bears in the Northern Hemisphere are often referred to by terms that avoid there sacred, powerful names: brown one, sweet foot, honey eater, or some kinship term such as grandfather or uncle. The list goes on when it comes to many supernatural entities.

For demons/the devil, there are also names employed to avoid naming Satan - and there is a common saying, "speak of the devil and he will appear" - encouraging people to avoid saying his name. He was, consequently, often referred to as Old Nick (from which we get nickle - the devil's, i.e. false, silver; pumpernickel - the devil's fart or turd, a name inspired by the dark round loaf). There are many other names for devil, all intended to avoid uttering the powerful nature of the arch demon's name.

Books can be written on the issue of the power of names - power that can manifest in both positive and negative ways. Suffice it to say here that according to European folk belief, the true name of something can have power over many things. This is clearly documented in folk belief.

edit to clarify issues surrounding the word "elf."