Shaving the head is preferrable to cutting the hair, although cutting the hair is permissible Sahih Muslim 1302 b

Arabic hadith text
وَحَدَّثَنِي أُمَيَّةُ بْنُ بِسْطَامَ، حَدَّثَنَا يَزِيدُ بْنُ زُرَيْعٍ، حَدَّثَنَا رَوْحٌ، عَنِ الْعَلاَءِ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم بِمَعْنَى حَدِيثِ أَبِي زُرْعَةَ عَنْ أَبِي هُرَيْرَةَ
Translation

A hadith like this is narrated on the authority of Abu Huraira.