Abdullah bin Abbas reported,

Ibn Abbas and Hurr bin Qays bin Hisn al-Fazari were disputing about the companion of Musa. Ubayy bin Kaab passed by them, so Ibn Abbas called him over and said, "My companion and I have been disputing about the companion of Musa, the one whom Musa asked about the way to meet. Did you hear the Messenger of Allah ﷺ mention his story?"Ubayy replied, "Yes, I heard the Prophet ﷺ tell his story. He said, 'While Musa was among a gathering of the Children of Israil, a man came to him and asked, "Do you know anyone more knowledgeable than yourself?" Musa answered, "No." So Allah revealed to Musa, "Yes, Our servant Khidr." Musa then asked about the way to meet him, and Allah made the fish a sign for him. He was told, "When you lose the fish, turn back, for you will meet him there." So Musa, peace be upon him, began to follow the trail of the fish in the sea. Musa's young companion said to him, "Did you see when we took refuge at the rock? Indeed, I forgot the fish, and none made me forget to mention it except Satan" [Kahf 18:63]. Musa said, "That is what we were seeking. So they returned, retracing their footsteps" [Kahf 18:64]. They found Khidr, and what happened between them was as Allah recounted in His Book.'"

Bukhari 78

Sahih

حدثنا أبو القاسم خالد بن خلي قاضي حمص قال حدثنا محمد بن حرب قال حدثنا الأوزاعي أخبرنا الزهري عن عبيد الله بن عبد الله بن عتبة بن مسعود

عن ابن عباس

أنه تمارى هو والحر بن قيس بن حصن الفزاري في صاحب موسى فمر بهما أبي بن كعب فدعاه ابن عباس فقال إني تماريت أنا وصاحبي هذا في صاحب موسى الذي سأل السبيل إلى لقيه هل سمعت رسول الله ﷺ يذكر شأنه فقال أبي نعم سمعت النبي ﷺ يذكر شأنه يقول بينما موسى في ملإ من بني إسرائيل إذ جاءه رجل فقال أتعلم أحدا أعلم منك قال موسى لا فأوحى الله عز وجل إلى موسى بلى عبدنا خضر فسأل السبيل إلى لقيه فجعل الله له الحوت آية وقيل له إذا فقدت الحوت فارجع فإنك ستلقاه فكان موسى صلى الله عليه يتبع أثر الحوت في البحر فقال فتى موسى لموسى {أرأيت إذ أوينا إلى الصخرة فإني نسيت الحوت وما أنسانيه إلا الشيطان أن أذكره} قال موسى {ذلك ما كنا نبغي فارتدا على آثارهما قصصا} فوجدا خضرا فكان من شأنهما ما قص الله في كتابه

البخاري 78صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Knowledge
Chapter
Going out in pursuit of knowledge
Numbering
Darussalam 78
Bukhari 78