In the old days, the picture of Zhong Kui was ted on the walls of almost all Chinese homes. He was represented as a fierce warrior with the head of a leopard and an imposing figure, wearing whisk- ers, a long robe, a pair of boots, and pointing his sword at a ghost under his feel Posting such a picture in one's home, according to tradition, would protect it from disasters and prolong one's life.
According to Notes Written in Dream, written by Shen Kuo of the Song Dynasty, once when Emperor Xuanzong (r. 712-756) of the Tang Dynasty was returning from reviewing his troops at Lishan on the outskirts ,of Xi'an, he suffered an attack of malaria. He was confined to bed for more than a month, despite efforts of the imperial physicians and witches to cure him. One night he dreamed of two demons. The smaller one, clad in a red robe with an apron round his waist, one foot in a boot and the other foot bare, was running away with the purple perfume-sachet of the emperor's favoured concubine, Lady Yang, and the emperor's own white jade flute which he had just stolen. The bigger demon, wearing a felt hat, a blue robe and a silk ribbon round his waist but no shoes on his feet, his sleeves rolled up, seized the little demon, gouged out his eyes and devoured him. When the emperor asked him who he was, the bigger demon replied, I am Zhong Kui of Zhongnan. I killed myself after I had failed in the examination for the selection of military officers, and I have vowed to exterminate all demons in the world for Your Majesty's sake. When the emperor awoke to find his ailment cured, he ordered the court painter Wu Daozi to paint a picture of Zhong Kui in the image or the ghost- tamer he saw in his dream. In addition, he issued an edict to the whole nation, ordering the picture of Zhong Kui hung in people's homes on New Year's Eve so as to drive away the ghosts and purify the evil atmosphere.
The Universal Joy by Zhang Dafu of the Qing Dynasty notes, In the Tang Dynasty, there lived a man named Zhong Kui in Zhongnan, who was a diligent student from a very poor family. In the year of a triennial national civil examination, with finan- cial support by kind-hearted neighbours, he went to the capital and passed the examination with hon- ours. In an interview given to the successful candi- dates, Emperor Dezong was displeased with the ugly looks of Zhong Kui and divested him of his title Zhong Kui died of a broken heart and, when hi: spirit drifted to hell, he poured forth his grievance, to the King of Hell. Moved by his uprightness, the King of Hell memorialized the Jade Emperor ir Heaven, who appointed Zhong Kui as Ghost- Taming General. Henceforth, Zhong Kui became a deity in command of ghosts.
As a matter of fact, the name of Zhong Kui underwent many changes. It appeared as far back as the Six Dynasties Period (from the early third to the late sixth century). Later, parents started to give their new-born babies names homophonic with that of Zhong Kui, in the hope that they would scare away evil spirits and grow up strong and healthy or live to be a hundred years old. By the Tang Dynasty, people had drawn a forced analogy from the tales about Zhong Kui and turned him from a guardian god against evil spirits into one capable of taming and devouring ghosts and demons the evil forces in the human world. There are several forms of writing for the name of Zhong Kui, all of which are somewhat homophonic with the Chinese character for cudgel (zhui). The scholar Gu Yanwu of the Ming-Qing period said in his Records of Daily Knowledge that this originated from the fact that the ancient Chinese used a zhui to ward off ghosts and demons.