Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:17651[Chain 1] Abū al-Ḥasan Muḥammad b. al-Ḥusayn al-ʿAlawī > ʿAbdullāh b. Muḥammad b. al-Ḥasan b. al-Sharqī > ʿAbdullāh b. Hāshim > Sufyān [Chain 2] Abū Muḥammad ʿAbdullāh b. Yūsuf al-Aṣbahānī > Abū Saʿīd Aḥmad b. Muḥammad b. Ziyād al-Baṣrī Bimakkah > al-Ḥasan b. Muḥammad al-Zaʿfarānī > Sufyān b. ʿUyaynah > al-Zuhrī > Sahl b. Saʿd al-Sāʿidī

[Machine] Sahl ibn Saad al-Saadi heard a man saying: "I saw a man come out of a hole in the room of the Messenger of Allah ﷺ, and he had a comb with which he was combing his head. He said: 'If I had known that you were watching, I would have stabbed you in the eye with it.' The permission to ask for permission was only given for the purpose of looking. This is the wording of the hadith of al-Za'faraani, and in the narration of Ibn Hashim it says: 'If I had known that you were looking at me.'"  

البيهقي:١٧٦٥١أَخْبَرَنَا أَبُو الْحَسَنِ مُحَمَّدُ بْنُ الْحُسَيْنِ الْعَلَوِيُّ أنبأ عَبْدُ اللهِ بْنُ مُحَمَّدِ بْنِ الْحَسَنِ بْنِ الشَّرْقِيِّ ثنا عَبْدُ اللهِ بْنُ هَاشِمٍ ثنا سُفْيَانُ ح وَأَخْبَرَنَا أَبُو مُحَمَّدٍ عَبْدُ اللهِ بْنُ يُوسُفَ الْأَصْبَهَانِيُّ أنبأ أَبُو سَعِيدٍ أَحْمَدُ بْنُ مُحَمَّدِ بْنِ زِيَادٍ الْبَصْرِيُّ بِمَكَّةَ ثنا الْحَسَنُ بْنُ مُحَمَّدٍ الزَّعْفَرَانِيُّ ثنا سُفْيَانُ بْنُ عُيَيْنَةَ عَنِ الزُّهْرِيِّ

سَمِعَ سَهْلَ بْنَ سَعْدٍ السَّاعِدِيَّ يَقُولُ اطَّلَعَ رَجُلٌ مِنْ جُحْرٍ فِي حُجْرَةِ رَسُولِ اللهِ ﷺ وَمَعَهُ مِدْرًى يَحُكُّ بِهِ رَأْسَهُ فَقَالَ لَوْ أَعْلَمُ أَنَّكَ تَنْظُرُ لَطَعَنْتُ بِهِ فِي عَيْنِكَ إِنَّمَا جُعِلَ الِاسْتِئْذَانُ مِنْ أَجْلِ النَّظَرِ لَفْظُ حَدِيثِ الزَّعْفَرَانِيِّ وَفِي رِوَايَةِ ابْنِ هَاشِمٍ لَوْ عَلِمْتُ أَنَّكَ تَنْظُرُنِي  

رَوَاهُ الْبُخَارِيُّ فِي الصَّحِيحِ عَنْ عَلِيٍّ وَرَوَاهُ مُسْلِمٌ عَنْ أَبِي بَكْرِ بْنِ أَبِي شَيْبَةَ وَغَيْرِهِ عَنْ سُفْيَانَ

See similar narrations below:

Collected by Bukhārī, Tirmidhī, Aḥmad
bukhari:6241ʿAlī b. ʿAbdullāh > Sufyān > al-Zuhrī Ḥafiẓtuh Kamā Annak Hā Hunā > Sahl b. Saʿd

A man peeped through a round hole into the dwelling place of the Prophet, while the Prophet ﷺ had a Midray (an iron comb) with which he was scratching his head. the Prophet ﷺ said, " Had known you were looking (through the hole), I would have pierced your eye with it (i.e., the comb)." Verily! The order of taking permission to enter has been enjoined because of that sight, (that one should not look unlawfully at the state of others). (See Hadith No. 807, Vol. 7)  

البخاري:٦٢٤١حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ اللَّهِ حَدَّثَنَا سُفْيَانُ قَالَ

الزُّهْرِيُّ حَفِظْتُهُ كَمَا أَنَّكَ هَا هُنَا عَنْ سَهْلِ بْنِ سَعْدٍ قَالَ اطَّلَعَ رَجُلٌ مِنْ جُحْرٍ فِي حُجَرِ النَّبِيِّ ﷺ وَمَعَ النَّبِيِّ ﷺ مِدْرًى يَحُكُّ بِهِ رَأْسَهُ فَقَالَ لَوْ أَعْلَمُ أَنَّكَ تَنْظُرُ لَطَعَنْتُ بِهِ فِي عَيْنِكَ إِنَّمَا جُعِلَ الاِسْتِئْذَانُ مِنْ أَجْلِ الْبَصَرِ  

tirmidhi:2709Ibn Abū ʿUmar > Sufyān > al-Zuhrī > Sahl b. Saʿd al-Sāʿidī

that a man peeked in on the Messenger of Allah ﷺ, in one of the apartments of the Prophet ﷺ, while the Prophet ﷺ had a Midrah (an iron comb) with which he was scratching his head. So the Prophet ﷺ said: "If I knew that you were looking then I would have poked your eyes with it. Seeking permission has only been enjoined because of the sight."  

Abū ʿĪsá said that this Ḥadīth is Ḥasan-Ṣaḥīḥ.
الترمذي:٢٧٠٩حَدَّثَنَا ابْنُ أَبِي عُمَرَ حَدَّثَنَا سُفْيَانُ عَنِ الزُّهْرِيِّ عَنْ سَهْلِ بْنِ سَعْدٍ السَّاعِدِيِّ

أَنَّ رَجُلاً اطَّلَعَ عَلَى رَسُولِ اللَّهِ ﷺ مِنْ جُحْرٍ فِي حُجْرَةِ النَّبِيِّ ﷺ وَمَعَ النَّبِيِّ ﷺ مِدْرَاةٌ يَحُكُّ بِهَا رَأْسَهُ فَقَالَ النَّبِيُّ ﷺ لَوْ عَلِمْتُ أَنَّكَ تَنْظُرُ لَطَعَنْتُ بِهَا فِي عَيْنِكَ إِنَّمَا جُعِلَ الاِسْتِئْذَانُ مِنْ أَجْلِ الْبَصَرِ وَفِي الْبَابِ عَنْ أَبِي هُرَيْرَةَ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ
ahmad:22802Sufyān > al-Zuhrī

[Machine] According to Sahel bin Saad, a man emerged from a hole in the Prophet's chamber while he had a comb in his hand and he was combing his hair with it. The man said, "If I knew you were watching, I would have stabbed your eye with it. Seeking permission is only for the sake of looking."  

أحمد:٢٢٨٠٢حَدَّثَنَا سُفْيَانُ عَنِ الزُّهْرِيِّ

عَنْ سَهْلِ بْنِ سَعْدٍ اطَّلَعَ رَجُلٌ مِنْ جُحْرٍ فِي حُجْرَةِ النَّبِيِّ ﷺ وَمَعَهُ مِدْرًى يَحُكُّ بِهِ رَأْسَهُ فَقَالَ لَوْ أَعْلَمُكَ تَنْظُرُ لَطَعَنْتُ بِهِعَيْنَكَ إِنَّمَا جُعِلَ الِاسْتِئْذَانُ مِنْ أَجْلِ الْبَصَرِ