صحيح البخاري Sahih Bukhari كتاب الأذان The Book of Adhan
بَابُ إِقَامَةِ الصَّفِّ مِنْ تَمَامِ الصَّلاَةِ:

(74) Chapter. The straightening of the rows is amongst those obligatory and good things which make your As-Salat (the prayer) a correct and perfect one.

2 hadith
Hadith 722
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ ، قَالَ : حَدَّثَنَا عَبْدُ الرَّزَّاقِ ، قَالَ : أَخْبَرَنَا مَعْمَرٌ ، عَنْ هَمَّامِ ، عَنْ أَبِي هُرَيْرَةَ ، عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، أَنَّهُ قَالَ : " إِنَّمَا جُعِلَ الْإِمَامُ لِيُؤْتَمَّ بِهِ فَلَا تَخْتَلِفُوا عَلَيْهِ ، فَإِذَا رَكَعَ فَارْكَعُوا ، وَإِذَا قَالَ : سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ فَقُولُوا : رَبَّنَا لَكَ الْحَمْدُ ، وَإِذَا سَجَدَ فَاسْجُدُوا ، وَإِذَا صَلَّى جَالِسًا فَصَلُّوا جُلُوسًا أَجْمَعُونَ ، وَأَقِيمُوا الصَّفَّ فِي الصَّلَاةِ فَإِنَّ إِقَامَةَ الصَّفِّ مِنْ حُسْنِ الصَّلَاةِ " .
Narrated Abu Huraira: The Prophet said, "The Imam is (appointed) to be followed. So do not differ from him, bow when he bows, and say, "Rabbana-lakal hamd" if he says "Sami`a l-lahu liman hamidah"; and if he prostrates, prostrate (after him), and if he prays sitting, pray sitting all together, and straighten the rows for the prayer, as the straightening of the rows is amongst those things which make your prayer a correct and perfect one. (See Hadith No. 657).
Hadith Reference Sahih Bukhari / The Book of Adhan / Hadith: 722
Hadith Grading محدثین: أحاديث صحيح البخاريّ كلّها صحيحة
Hadith 723
حَدَّثَنَا أَبُو الْوَلِيدِ ، قَالَ : حَدَّثَنَا شُعْبَةُ ، عَنْ قَتَادَةَ ، عَنْ أَنَسٍ ، عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، قَالَ : " سَوُّوا صُفُوفَكُمْ فَإِنَّ تَسْوِيَةَ الصُّفُوفِ مِنْ إِقَامَةِ الصَّلَاةِ " .
Narrated Anas bin Malik: The Prophet said, "Straighten your rows as the straightening of rows is essential for a perfect and correct prayer. "
Hadith Reference Sahih Bukhari / The Book of Adhan / Hadith: 723
Hadith Grading محدثین: أحاديث صحيح البخاريّ كلّها صحيحة