Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Whoever acquires knowledge of something through which the pleasure of Allah is sought, learning it only to gain some worldly advantage, will not find the fragrance of Paradise on the Day of Resurrection," meaning its scent.Abu al-Hasan said, Abu Hatim informed us, Saeed bin Mansur narrated to us, Fulayh bin Sulayman narrated to us, and he mentioned something similar.

Ibn Majah 252

Hasan

حدثنا أبو بكر بن أبي شيبة حدثنا يونس بن محمد وسريج بن النعمان قالا حدثنا فليح بن سليمان عن عبد الله بن عبد الرحمن بن معمر أبي طوالة عن سعيد بن يسار

عن أبي هريرة قال

قال رسول الله ﷺ من تعلم علما مما يبتغى به وجه الله لا يتعلمه إلا ليصيب به عرضا من الدنيا لم يجد عرف الجنة يوم القيامة يعني ريحها قال أبو الحسن أنبأنا أبو حاتم حدثنا سعيد بن منصور حدثنا فليح بن سليمان فذكر نحوه

ابن ماجه 252حسن
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Sunnah
Chapter
Benefiting from knowledge and acting upon it
Numbering
Darussalam 252
Ibn Majah 252