Sayyidina Ibn Umar said that Allah’s Messenger (SAW) had his hair shaved and a section of his Companions also had their hair shaved, but some of them had theirs clipped. He added that Allah’s Messenger (SAW) said once or twice, “May Allah have mercy on those who have shaved.” After that he said, “And those who have clipped.”
[Ahmed6012, Bukhari 1727, Muslim 1301, Ibn e Majah 3044]