صحيح مسلم Sahih Muslim كتاب صلاة المسافرين وقصرها The Book of Prayer - Travellers
باب اسْتِحْبَابِ تَحِيَّةِ الْمَسْجِدِ بِرَكْعَتَيْنِ وَكَرَاهَةِ الْجُلُوسِ قَبْلَ صَلاَتِهِمَا وَأَنَّهَا مَشْرُوعَةٌ فِي جَمِيعِ الأَوْقَاتِ:

Chapter: It is recommended to greet the masjid by praying two rak`ah, and it is disliked to sit before praying these two rak`ah, and this is prescribed at all times

3 hadith
Hadith 714
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ بْنِ قَعْنَبٍ ، وَقُتَيْبَةُ بْنُ سَعِيدٍ ، قَالَا : حَدَّثَنَا مَالِكٌ . ح ، وحَدَّثَنَا يَحْيَى بْنُ يَحْيَى ، قَالَ : قَرَأْتُ عَلَى مَالِكٍ ، عَنْ عَامِرِ بْنِ عَبْدِ اللَّهِ بْنِ الزُّبَيْرِ ، عَنْ عَمْرِو بْنِ سُلَيْمٍ الزُّرَقِيِّ ، عَنْ أَبِي قَتَادَةَ ، أَنّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، قَالَ : " إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ ، فَلْيَرْكَعْ رَكْعَتَيْنِ ، قَبْلَ أَنْ يَجْلِسَ " .
Abu Qatadah (RA) (a Companion of the Prophet) reported Allah's Messenger (ﷺ) as saying: When any one of you enters the mosque, he should observe two rak'ahs (of Nafl prayer) before sitting.
Hadith Reference Sahih Muslim / The Book of Prayer - Travellers / Hadith: 714
Hadith Grading محدثین: أحاديث صحيح مسلم كلها صحيحة
Hadith Takhrij «أحاديث صحيح مسلم كلها صحيحة»
Hadith 714
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ ، حَدَّثَنَا حُسَيْنُ بْنُ عَلِيٍّ ، عَنْ زَائِدَةَ ، قَالَ : حَدَّثَنِي عَمْرُو بْنُ يَحْيَى الأَنْصَارِيُّ ، حَدَّثَنِي مُحَمَّدُ بْنُ يَحْيَى بْنِ حَبَّانَ ، عَنِ عَمْرِو بْنِ سُلَيْمِ بْنِ خَلْدَةَ الأَنْصَارِيِّ ، عَنْ أَبِي قَتَادَةَ صَاحِبِ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، قَالَ : " دَخَلْتُ الْمَسْجِدَ وَرَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، جَالِسٌ بَيْنَ ظَهْرَانَي النَّاسِ ، قَالَ : فَجَلَسْتُ ، فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : مَا مَنَعَكَ أَنْ تَرْكَعَ رَكْعَتَيْنِ قَبْلَ أَنْ تَجْلِسَ ؟ قَالَ : فَقُلْتُ : يَا رَسُولَ اللَّهِ ، رَأَيْتُكَ جَالِسًا ، وَالنَّاسُ جُلُوسٌ ، قَالَ : " فَإِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ ، فَلَا يَجْلِسْ حَتَّى يَرْكَعَ رَكْعَتَيْنِ " .
Abu Qatadah (RA)h (RA), a Companion of the Messenger of Allah (ﷺ) , said: I entered the mosque, when the Messenger of Allah (ﷺ) had been sitting among people, and I also sat down among them. Upon this the Messenger of Allah (ﷺ) said: What prevented you from offering two rak'ahs (of Nafl prayer) before sitting down? I said: Messenger of Allah, I saw you sitting and people sitting (around you and I, therefore, sat in your company). He (the Holy Prophet) then said: When anyone among you enters the mosque, he should not sit till he has observed two rak'ahs.
Hadith Reference Sahih Muslim / The Book of Prayer - Travellers / Hadith: 714
Hadith Grading محدثین: أحاديث صحيح مسلم كلها صحيحة
Hadith Takhrij «أحاديث صحيح مسلم كلها صحيحة»
Hadith 715
حَدَّثَنَا أَحْمَدُ بْنُ جَوَّاسٍ الْحَنَفِيُّ أَبُو عَاصِمٍ ، حَدَّثَنَا عُبَيْدُ اللَّهِ الأَشْجَعِيُّ ، عَنْ سُفْيَانَ ، عَنْ مُحَارِبِ بْنِ دِثَارٍ ، عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ ، قَالَ : " كَانَ لِي عَلَى النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ دَيْنٌ ، فَقَضَانِي ، وَزَادَنِي ، وَدَخَلْتُ عَلَيْهِ الْمَسْجِدَ ، فَقَالَ لِي : " صَلِّ رَكْعَتَيْنِ " .
Jabir bin 'Abdullah reported: The Apostle of Allah (ﷺ) owed me a debt; he paid me back and made an addition (of this). I entered the mosque and he (the Holy Prophet) said to me: Observe two rak'ahs of prayer.
Hadith Reference Sahih Muslim / The Book of Prayer - Travellers / Hadith: 715
Hadith Grading محدثین: أحاديث صحيح مسلم كلها صحيحة
Hadith Takhrij «أحاديث صحيح مسلم كلها صحيحة»