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.
muslim:2234cʿUmar b. Ḥafṣ b. Ghiyāth from my father > al-Aʿmash > Ibrāhīm > al-Aswad > ʿAbdullāh

While we were with the Messenger of Allah ﷺ in the cave, the rest of the hadith is the same as the one narrated above.  

مسلم:٢٢٣٤cوَحَدَّثَنَا عُمَرُ بْنُ حَفْصِ بْنِ غِيَاثٍ حَدَّثَنَا أَبِي حَدَّثَنَا الأَعْمَشُ حَدَّثَنِي إِبْرَاهِيمُ عَنِ الأَسْوَدِ عَنْ عَبْدِ اللَّهِ قَالَ

بَيْنَمَا نَحْنُ مَعَ رَسُولِ اللَّهِ ﷺ فِي غَارٍ بِمِثْلِ حَدِيثِ جَرِيرٍ وَأَبِي مُعَاوِيَةَ