Ka’b ibn Malik reported: The Prophet, peace and blessings be upon him, said, “Whoever seeks knowledge to impress the scholars, to argue with the foolish, or to attract the attention of people, Allah will admit him into Hellfire.”
Source: Sunan al-Tirmidhī 2654
Grade: Hasan (fair) according to Al-Albani
عَنْ كَعْبِ بْنِ مَالِكٍ عَنْ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ مَنْ طَلَبَ الْعِلْمَ لِيُجَارِيَ بِهِ الْعُلَمَاءَ أَوْ لِيُمَارِيَ بِهِ السُّفَهَاءَ أَوْ يَصْرِفَ بِهِ وُجُوهَ النَّاسِ إِلَيْهِ أَدْخَلَهُ اللَّهُ النَّارَ
2654 سنن الترمذي كتاب العلم باب ما جاء فيمن يطلب بعلمه الدنيا
2654 المحدث الألباني خلاصة حكم المحدث حسن في صحيح الترمذي