The goal for a Muslim is to attain the pleasure of Allah. Not only Jannah, but the pleasure of Allah which is even greater. The greatest, utmost end of any Muslim to die and have the Lord of the Worlds to be pleased with us. And any act that we do in our lives, from doing worship to smiling, to visiting our brothers and sisters, whatever the action is, in every action this should be our intention: to gain the pleasure of Allah. This is the end of ends. The final thing, the utmost thing, the greatest thing. And if only Muslims today could realise that one of their greatest problems are taking things that are supposed to be means, as ends!
Knowledge is not an end in and of itself. It is a means for a person to arrive to the knowledge of Allah. This is why Allah tells us in the Quran, Allah commands us in the Quran to fear Him and have taqwa. But what is the result of us establishing taqwa? That fear Allah and Allah will teach you. These are the knowledges that Allah talks about when He speaks of the knowledge of Sayyidna Khidr.
~Unknown teacher (class from 2008)