The Messenger of Allah ﷺ said, "O Allah, forgive those who shave their heads."They said, "Messenger of Allah, and those who shorten their hair?"He said, "O Allah, forgive those who shave their heads," three times.They said, "Messenger of Allah, and those who shorten their hair?"He said, "And those who shorten their hair."
حدثنا أبو بكر بن أبي شيبة وعلي بن محمد قالا حدثنا محمد بن فضيل حدثنا عمارة بن القعقاع عن أبي زرعة
قال رسول الله ﷺ اللهم اغفر للمحلقين قالوا يا رسول الله والمقصرين قال اللهم اغفر للمحلقين ثلاثا قالوا يا رسول الله والمقصرين قال والمقصرين
Bukhari narrated it in the book of Hajj, chapter on shaving or trimming the hair upon completing the rites, hadith no. 1728, through the hadith of Ibn Fudayl, with this chain. Muslim narrated it in the book of Hajj, chapter on the superiority of shaving over trimming and the permissibility of trimming, hadith no. 1302, from Ibn Abu Shayba, with this chain.