Narrated Said bin Jubair:
I said to Ibn 'Abbas, "Nauf-al-Bakali " claims that Moses of Bani Israel was not Moses, the companion of Al-Khadir." Ibn 'Abbas said, "Allah's enemy tells a lie! Ubai bin Ka'b narrated to us that Allah's Apostle ﷺ said, 'Moses got up to deliver a sermon before Bani Israel and he was asked, 'Who is the most learned person among the people?' Moses replied, 'I (am the most learned).' Allah then admonished Moses for he did not ascribe all knowledge to Allah only (Then) came the Divine Inspiration:-- 'Yes, one of Our slaves at the junction of the two seas is more learned than you.' Moses said, 'O my Lord ! How can meet him?' Allah said, 'Take a fish in a basket and wherever the fish is lost, follow it (you will find him at that place). So Moses set out along with his attendant Yusha' bin Nun, and they carried with them a fish till they reached a rock and rested there. Moses put his head down and slept. (Sufyan, a sub-narrator said that somebody other than 'Amr said) 'At the rock there was a water spring called 'Al-Hayat' and none came in touch with its water but became alive. So some of the water of that spring fell over that fish, so it moved and slipped out of the basket and entered the sea. When Moses woke up, he asked his attendant, 'Bring our early meal' (18.62). The narrator added: Moses did not suffer from fatigue except after he had passed the place he had been ordered to observe. His attendant Yusha bin Nun said to him, 'Do you remember (what happened) when we betook ourselves to the rock? I did indeed forget (about) the fish ...' (18.63) The narrator added: So they came back, retracing their steps and then they found in the sea, the way of the fish looking like a tunnel. So there was an astonishing event for his attendant, and there was tunnel for the fish. When they reached the rock, they found a man covered with a garment. Moses greeted him. The man said astonishingly, 'Is there any such greeting in your land?' Moses said, 'I am Moses.' The man said, 'Moses of Bani Israel?' Moses said, 'Yes,' and added, 'may I follow you so that you teach me something of the Knowledge which you have been taught?' (18.66). Al-Khadir said to him, 'O Moses! You have something of Allah's knowledge which Allah has taught you and which I do not know;
and I have something of Allah's knowledge which Allah has taught me and which you do not know.' Moses said, 'But I will follow you.' Al-Khadir said, 'Then if you follow me, ask me no question about anything until I myself speak to you concerning it.' (18.70). After that both of them proceeded along the seashore. There passed by them a boat whose crew recognized Al-Khadir and received them on board free of charge. So they both got on board. A sparrow came and sat on the edge of the boat and dipped its beak unto the sea. Al-Khadir said to Moses. 'My knowledge and your knowledge and all the creation's knowledge compared to Allah's knowledge is not more than the water taken by this sparrow's beak.' Then Moses was startled by Al-Khadir's action of taking an adze and scuttling the boat with it. Moses said to him, 'These people gave us a free lift, but you intentionally scuttled their boat so as to drown them. Surely you have...' (18.71) Then they both proceeded and found a boy playing with other boys. Al-Khadir took hold of him by the head and cut it off. Moses said to him, 'Have you killed an innocent soul who has killed nobody? Surely you have done an illegal thing! ' (18.74) He said, "Didn't I tell you that you will not be able to have patient with me up to ..but they refused to entertain them as their guests. There they found a wall therein at the point of collapsing.' (18.75-77) Al-Khadir moved his hand thus and set it upright (repaired it). Moses said to him, 'When we entered this town, they neither gave us hospitality nor fed us;
if you had wished, you could have taken wages for it,' Al-Khadir said, 'This is the parting between you and me I will tell you the interpretation of (those things) about which you were unable to hold patience.'...(18.78) Allah's Apostle ﷺ said, 'We wished that Moses could have been more patient so that He (Allah) could have described to us more about their story.' Ibn 'Abbas used to recite:-- 'And in front (ahead) of them there was a king who used to seize every (serviceable) boat by force. (18.79) ...and as for the boy he was a disbeliever. "
Sahih al-Bukhari, Vol. 6, Book of Prophetic Commentary on the Qur'an, Hadith 251
Sahih al-Bukhari, Book of Prophetic Commentary on the Qur'an, Hadith 251