‘Awf ibn Abi Jamilah reported: Al-Hasan al-Basri, may Allah have mercy on him, said, “It is part of charity to learn sacred knowledge, and then teach it to the people.”
Source: Sharḥ Madhāhib Ahl al-Sunnah 1/53
عَنْ عَوْفِ بْنِ أَبِي جَمِيلَةَ عَنِ الحَسَنِ الْبَصْرِيِّ رَحِمَهُ اللهُ أَنَّهُ قَال مِنَ الصَّدَقَةِ أَنْ تَعَلَّمَ الْعِلْمَ ثُمَّ تُعَلِّمَهُ لِلنَّاسِ
1/53 شرح مذاهب أهل السنة لابن شاهين