In the name of Allah the most merciful the wise
This shaving of the infants head is called Aqiqah. The shaving of the hair of the child on the seven day is mustahab (commendable/ desirable) in the Hanafi School of thought. One will give silver in sadaqah to the poor and needy equal to the weight of the infant’s hair. This can be done by merely estimating the weight of the child’s hair.
It is suggested that shaving the hair of the head provides the child with strength and opens up the pores of the skin. It is also beneficial to the Childs other senses such as eyesight, hearing and sense of smell. Besides, the poor are also assisted to a degree with the Sadaqah offered.
Aqiqah is not mentioned in the Quran, but it is mentioned the Hadith. It is reported in ?Sahih Ibn Habbaan (Pg 355-357)? under the authority of Anas bin Malik, that Rasulullah Sallahu Alaihi Wasalam performed Aqiqah on Hasan and Husain.
Similar passages and text have being mentioned in Fathul Bari, volume 9 732-734.
And Allah the All-Wise knows best