Sunan al-Darimi 261
أَخْبَرَنَا يَعْلَى، حَدَّثَنَا مُحَمَّدُ بْنُ عَوْنٍ، عَنْ إِبْرَاهِيمَ بْنِ عِيسَى، قَالَ: قَالَ ابْنُ مَسْعُودٍ: «لَا تَعَلَّمُوا الْعِلْمَ لِثَلَاثٍ لِتُمَارُوا بِهِ السُّفَهَاءَ، وَتُجَادِلُوا بِهِ الْعُلَمَاءَ، وَلِتَصْرِفُوا بِهِ وُجُوهَ النَّاسِ إِلَيْكُمْ، وَابْتَغُوا بِقَوْلِكُمْ مَا عِنْدَ اللَّهِ، فَإِنَّهُ يَدُومُ وَيَبْقَى وَيَنْفَدُ مَا سِوَاهُ»
Yaʿla informed us; he said: Muhammad ibn ʿAwn narrated to us, from Ibrahim ibn ʿIsa, who said: Ibn Masʿud said: "Do not learn knowledge for three [reasons]: to dispute with the foolish by it, to argue with the scholars by it, and to turn people's faces towards you by it. Seek by your words what is with Allah, for that lasts and remains, and everything besides it runs out."