The Messenger of Allah ﷺ said, "O Allah, have mercy on those who shave their heads."The people asked, "And those who shorten their hair, Messenger of Allah?"He said, "O Allah, have mercy on those who shave their heads."They asked again, "And those who shorten their hair, Messenger of Allah?"He said, "And those who shorten their hair."
أن رسول الله ﷺ قال: اللهم ارحم المحلقين. قالوا: والمقصرين يا رسول الله؟ قال: اللهم ارحم المحلقين. قالوا: والمقصرين يا رسول الله؟ قال: والمقصرين.
Malik narrated it in Hajj (184) from Nafi, from Abdullah bin Umar, and he related it.Bukhari narrated it in Hajj (1727), and Muslim narrated it in Hajj (1301:317), both of them by way of Malik, with the same chain, similarly.There are many hadiths on this subject, and they are mentioned in the book of Hajj and the book of Sirah.