‘Ata’ b. Yasar told that when God’s messenger was in the mosque a man whose head and beard were dishevelled entered, and God’s messenger pointed his hand at him as though he were ordering him to arrange his hair and his beard. When he had done so and returned, God's messenger said, “Is this not better than that one of you should come with his head dishevelled, as though he were a devil ?”
Malik transmitted it.
“God is good and likes what is fragrant (Tayyib is ‘good’ and tib is ‘perfume’, or ‘fragrance.’); clean and likes cleanliness; generous and likes generosity; munificent and likes munificence; so cleanse (I think he said, your courtyards), and do not imitate the Jews.” I mentioned that to Muhajir b. Mismar and he said he had been told by ‘Amir b. Sa‘d, on his father’s authority, that the Prophet had said something similar, but he said, “Cleanse your courtyards.”
Tirmidhi transmitted it.
We went in to visit Anas b. Malik, and my sister al-Mughira told me that at that time I was a youth with two plaits of hair (The text mentions qarnan or qussatan. The former would mean two side plaits and the latter two plaits over the forehead. The alternative is given evidently because the transmitter is not sure which was the correct word), and he wiped my head, invoked a blessing on me and said, “Shave these two, or clip them, for this is the style of the Jews.”
Abu Dawud transmitted it.