Sahih al-Bukhari, Book 61, Hadith 101 (In-Book)

Narrated Abu Sa`id Al-Khudri: The Prophet said, "A time will come when the people will wage holy war, and it will be asked, 'Is there any amongst you who has enjoyed the company of Allah's Messenger?' They will say: 'Yes.' And then victory will be bestowed upon them. They will wage holy war again, and it will be asked: 'Is there any among you who has enjoyed the company of the companions of Allah's Messenger ?' They will say: 'Yes.' And then victory will be bestowed on them."

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

sunnah.com