Language:
كتاب اللباس
77  
Dress
(75)
Chapter: Combing one's hair
(75)
باب الاِمْتِشَاطِ
Sahih al-Bukhari 5924

Narrated Sa`d:

A man peeped into the house of the Prophet (ﷺ) through a hole while the Prophet (ﷺ) was scratching his head with a Midrai (a certain kind of comb). On that the Prophet (ﷺ) said (to him), "If I had known you had been looking, then I would have pierced your eye with that instrument, because the asking of permission has been ordained so that one would not see things unlawfully."

حَدَّثَنَا آدَمُ بْنُ أَبِي إِيَاسٍ، حَدَّثَنَا ابْنُ أَبِي ذِئْبٍ، عَنِ الزُّهْرِيِّ، عَنْ سَهْلِ بْنِ سَعْدٍ، أَنَّ رَجُلاً، اطَّلَعَ مِنْ جُحْرٍ فِي دَارِ النَّبِيِّ صلى الله عليه وسلم وَالنَّبِيُّ صلى الله عليه وسلم يَحُكُّ رَأْسَهُ بِالْمِدْرَى فَقَالَ ‏ "‏ لَوْ عَلِمْتُ أَنَّكَ تَنْظُرُ لَطَعَنْتُ بِهَا فِي عَيْنِكَ، إِنَّمَا جُعِلَ الإِذْنُ مِنْ قِبَلِ الأَبْصَارِ ‏"‏‏.‏
Reference : Sahih al-Bukhari 5924
In-book reference : Book 77, Hadith 139
USC-MSA web (English) reference : Vol. 7, Book 72, Hadith 807
  (deprecated numbering scheme)