(28) باب تَسْوِيَةِ الصُّفُوفِ وَإِقَامَتِهَا وَفَضْلِ الأَوَّلِ فَالأَوَّلِ مِنْهَا وَالاِزْدِحَامِ عَلَى الصَّفِّ الأَوَّلِ وَالْمُسَابَقَةِ إِلَيْهَا وَتَقْدِيمِ أُولِي الْفَضْلِ وَتَقْرِيبِهِمْ مِنَ الإِمَامِ
Hammam b. Munabbih reported:
This is what was transmitted to us by Abu Huraira from the Messenger of Allah (ﷺ) and, while making a mention of a few ahadith, said: (The Messengerof Allah directed us thus): Establish rows in prayer, for the making of a row (straight) is one of the merits of prayer.
Reference: Sahih Muslim 435
In-book reference: Book 4, Hadith 139
USC-MSA web (English) reference(deprecated numbering scheme): Book 4, Hadith 873