Riyad as-Salihin, Book 2, Hadith 727 (In-Book)

Anas (May Allah be pleased with him) reported: When Messenger of Allah went to Mina, he came to Jamrat-ul-'Aqabah and threw pebbles at it. After that, he went to his lodge in Mina and sacrificed. Then he called for a barber and pointed his right side to him, said, "Shave from here." Then he pointed his left side and said, "Take (hair) from here." Then he distributed his hair among the people.[Al-Bukhari and Muslim].Another narration is: After the Messenger of Allah had thrown pebbles at Jamrah and sacrificed an animal, he turned the right side of his head towards the barber who shaved it for him. Then he called Abu Talhah Ansari (May Allah be pleased with him) and gave his hair to him. Then he turned his head to the left side and asked the barber to shave it. He gave the hair to Abu Talhah and told him, "Distribute it among the people."

وعن أنس رضي الله عنه أن رسول الله صلى الله عليه وسلم أتى منى‏:‏ فأتى الجمرة فرماها، ثم أتى منزله بمنى، ونحر، ثم قال للحلاق “خذ” وأشار إلى جانبه الأيمن، ثم الأيسر، ثم جعل يعطيه الناس‏.‏ ‏(‏‏(‏متفق عليه‏)‏‏)‏ ‏.‏وفي رواية‏:‏ لما رمى الجمرة، ونحر نسكه وحلق‏:‏ ناول الحلاق شقه الأيمن فحلقه، ثم دعا أبا طلحة الأنصارى رضي الله عنه ، فأعطاه إياه،ثم ناوله الشق الأيسر فقال “احلق” فحلقه فأعطاه أبا طلحة فقال‏:‏ ‏ "‏اقسمه بين الناس‏" ‏‏.‏

sunnah.com