Al-Bayḥaqī narrated with his isnād that ‘Abd al-‘Azīz ibn ‘Abdillāh al-Uwaysī said:
“Mālik ibn Anas (may Allāh have mercy on him) mentioned that some people shave their moustaches, and he said: ‘The one who does that should be beaten.’ The ḥadith of the Prophet (peace and blessings of Allāh be upon him) about the moustache does not speak of shaving, rather it should be trimmed just enough to let the edge of the lips and the mouth show.”
Mālik ibn Anas (may Allāh have mercy on him) said: “Shaving the moustache is a bid’ah (innovation) that has appeared among the people.”
—Al-Sunan al-Kubrā (1/151)
Abul-Walīd al-Bājī said:
Ibn ‘Abd al-Ḥakam narrated from Imām Mālik: “Trimming the moustache does not mean shaving it. I think that the one who shaves his moustache should be disciplined.” Ashhab ibn Mālik narrated: “Shaving it is a bid’ah (innovation).”
Imām Mālik (may Allāh have mercy on him) said: “It was narrated from ‘Umar ibn al-Khaṭṭāb (may Allāh be pleased with him) that when he was upset by something, he would twist his moustache. If it was shaved off, there would be nothing to twist.”
—Al-Muntaqā Sharḥ al-Muwaṭṭa’ (7/266)
The Shāfiʻī position is the same as the Maliki position in this regard as can be seen here:
Imām al-Nawawī (may Allāh have mercy on him) said:
“The guideline on trimming the moustache is that it should be trimmed so that the edge of the lip can be seen, but it should not be shaved off completely. This is our view.”
—Al-Majmūʻ (1/34-341)
The Muḥaddith of Upper Egypt and master of the Mālikī and Shāfiʻī madhhabs, Imām Ibn Daqīq al-ʻĪd (may Allāh have mercy on him) said:
“I am not aware of anyone who said that the entire moustache is to be cut and removed.”