Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ahmad-zuhd:550ʿAbdullāh > Bī > ʿAbd al-Razzāq > Maʿmar > ʿAbd al-Razzāq Abū ʿUthmān Shaykh from Ahl al-Baṣrah > Luqmān

[Machine] "To his son, 'O my son, do not desire the friendship of the ignorant, for he will think that you approve of his actions and do not belittle the dislike of the wise, for he will boycott you.'"  

الزهد لأحمد:٥٥٠حَدَّثَنَا عَبْدُ اللَّهِ حَدَّثَنَا أبِي أَخْبَرَنَا عَبْدُ الرَّزَّاقِ أَنْبَأَنَا مَعْمَرٌ عَنْ عَبْدِ الرَّزَّاقِ أَبِي عُثْمَانَ شَيْخٌ مِنْ أَهْلِ الْبَصْرَةِ أَنَّ لُقْمَانَ قَالَ

لِابْنِهِ «يَا بُنَيَّ لَا تَرْغَبْ فِي وُدِّ الْجَاهِلِ؛ فَيَرَى أَنَّكَ تَرْضَى عَمَلَهُ وَلَا تَتَهَاوَنْ بِمَقْتِ الْحَكِيمِ فَيَزْهَدَ فِيكَ»