وَحَدَّثَنِي عَنْ مَالِكٍ، عَنْ زَيْدِ بْنِ أَسْلَمَ، أَنَّ عَطَاءَ بْنَ يَسَارٍ، أَخْبَرَهُ قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم فِي الْمَسْجِدِ فَدَخَلَ رَجُلٌ ثَائِرَ الرَّأْسِ وَاللِّحْيَةِ فَأَشَارَ إِلَيْهِ رَسُولُ اللَّهِ صلى الله عليه وسلم بِيَدِهِ أَنِ اخْرُجْ كَأَنَّهُ يَعْنِي إِصْلاَحَ شَعَرِ رَأْسِهِ وَلِحْيَتِهِ فَفَعَلَ الرَّجُلُ ثُمَّ رَجَعَ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ أَلَيْسَ هَذَا خَيْرًا مِنْ أَنْ يَأْتِيَ أَحَدُكُمْ ثَائِرَ الرَّأْسِ كَأَنَّهُ شَيْطَانٌ ‏"‏ ‏.‏

Yahya related to me from Malik from Zayd ibn Aslam that Ata ibnYasar told him that the Messenger of Allah, may Allah bless him andgrant him peace, was in the mosque when a man came in with dishevelledhair and beard. The Messenger of Allah. may Allah bless him and granthim peace, motioned with his hand that he should be sent out to groomhis hair and beard. The man did so and then returned. The Messenger ofAllah, may Allah bless him and grant him peace, said, "Isn't thisbetter than that one of you should come with his head dishevelled, asif he were a shaytan?" Translation Not Available

Book Ref: Muwatta Imam Malik Book 51 Hadith 1739
Web Ref:  Muwatta Imam Malik Book 51 Hadith 7