Sahih al-Bukhari, Book 27, Hadith 9 (Bukhari 1746)

Narrated `Abdur-Rahman bin Abu Layla:

Ka`b bin 'Ujra said that Allah's Messenger (ﷺ) said to him (Ka`b), "Perhaps your lice have troubled you?" Ka`b replied, "Yes! O Allah's Messenger (ﷺ)." Allah's Messenger (ﷺ) said, "Have your head shaved and then either fast three days or feed six poor persons or slaughter one sheep as a sacrifice."