Shaving the head is preferrable to cutting the hair, although cutting the hair is permissible Sahih Muslim 1304
Arabic hadith text
وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا يَعْقُوبُ، وَهُوَ ابْنُ عَبْدِ الرَّحْمَنِ الْقَارِيُّ ح وَحَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا حَاتِمٌ، - يَعْنِي ابْنَ إِسْمَاعِيلَ - كِلاَهُمَا عَنْ مُوسَى بْنِ عُقْبَةَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلمحَلَقَ رَأْسَهُ فِي حَجَّةِ الْوَدَاعِ .
Translation
Ibn Umar reported that Allah's Messenger (ﷺ) got his head shaved on the occasion of the Farewell Pilgrimage.