In The Name of Allaah, The Most Merciful, The Bestower of Mercy
Allaah [The Exalted] said:
وَمَا كَانَ الْمُؤْمِنُونَ لِيَنفِرُوا كَافَّةً ۚ فَلَوْلَا نَفَرَ مِن كُلِّ فِرْقَةٍ مِّنْهُمْ طَائِفَةٌ لِّيَتَفَقَّهُوا فِي الدِّينِ وَلِيُنذِرُوا قَوْمَهُمْ إِذَا رَجَعُوا إِلَيْهِمْ لَعَلَّهُمْ يَحْذَرُونَ
And it is not (proper) for the believers to go out to fight (Jihad) all together. Of every troop of them, a party only should go forth, that they (who are left behind) may get instructions in (Islamic) religion, and that they may warn their people when they return to them, so that they may beware (of evil). [Surah At-tawbah’ A ayah 122]
Look [at this]! There is an aim [or goal] behind knowledge. The one who boasts to the people about knowledge will not be able to acquire it, [rather the goal behind knowledge] is to give warning to your people. You [should] seek knowledge for the sake of Allaah and sincerely. Therefore, your intention -after sincerity – should be to benefit the people. And those worthier – first and foremost – to be benefited are your close relatives and family. You owe them a right to be fulfilled before all the people.
Marhaban Yaa Taalibal Ilm. Page 249. Slightly paraphrased