Shaving the head is preferrable to cutting the hair, although cutting the hair is permissible Sahih Muslim 1303
Arabic hadith text
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا وَكِيعٌ، وَأَبُو دَاوُدَ الطَّيَالِسِيُّ عَنْ شُعْبَةَ، عَنْ يَحْيَى بْنِ الْحُصَيْنِ، عَنْ جَدَّتِهِ، أَنَّهَا سَمِعَتِ النَّبِيَّ صلى الله عليه وسلم فِي حَجَّةِ الْوَدَاعِدَعَا لِلْمُحَلِّقِينَ ثَلاَثًا وَلِلْمُقَصِّرِينَ مَرَّةً .وَلَمْ يَقُلْ وَكِيعٌ فِي حَجَّةِ الْوَدَاعِ
Translation
Yahya b. al-Husain reported on the authority of his grandfather that Allah's Apostle (ﷺ) invoked blessing on the occasion of the Farewell Pilgrimage three times for those who got their heads shaved and once for those who got their hair clipped. In the narration transmitted by Waki' there is no mention of the Farewell Pilgrimage.