The Prophet ﷺ shaved his head, as did a group of his companions, while others trimmed their hair.
حلق النبي ﷺ وطائفة من أصحابه، وقصر بعضهم.
Bukhari narrated it in the Hajj (1729) through Juwayria bin Asma, from Nafi, from Ibn Umar, as mentioned. Muslim also narrated it in the Hajj (1301) from the hadith of Layth, from Nafi, with the same wording. He added, Abdullah (Ibn Umar) said, the Messenger of Allah ﷺ said, "May Allah have mercy on those who shave their heads," once or twice, then said, "And on those who shorten their hair."