Sahih al-Bukhari, Book 64, Hadith 230 (In-Book)

Narrated Ka`b bin Ujra: The Prophet came to me at the time of Al-Hudaibiya Pledge while lice were falling on my face. He said, "Are the lice of your head troubling you?" I said, "Yes." He said, "Shave your head and fast for three days, or feed six poor persons, or slaughter a sheep as sacrifice." (The sub-narrator, Aiyub said, "I do not know with which of these three options he started.")

حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ أَيُّوبَ، عَنْ مُجَاهِدٍ، عَنِ ابْنِ أَبِي لَيْلَى، عَنْ كَعْبِ بْنِ عُجْرَةَ ـ رضى الله عنه ـ قَالَ أَتَى عَلَىَّ النَّبِيُّ صلى الله عليه وسلم زَمَنَ الْحُدَيْبِيَةِ، وَالْقَمْلُ يَتَنَاثَرُ عَلَى وَجْهِي فَقَالَ ‏{‏أَيُؤْذِيكَ هَوَامُّ رَأْسِكَ‏}‏‏.‏ قُلْتُ نَعَمْ‏.‏ قَالَ ‏ "‏ فَاحْلِقْ، وَصُمْ ثَلاَثَةَ أَيَّامٍ، أَوْ أَطْعِمْ سِتَّةَ مَسَاكِينَ، أَوِ انْسُكْ نَسِيكَةً ‏" ‏‏.‏ قَالَ أَيُّوبُ لاَ أَدْرِي بِأَىِّ هَذَا بَدَأَ‏.‏

sunnah.com