كتاب الصلاة
4  
The Book of Prayers
(28)
Chapter: Straightening The Rows; The Virtue Of The Front Row And Then The Next; Competing With One Another For The Front Row; The People Of Virtue Should Take Precedence And Be Closest To The Imam
(28)
باب تَسْوِيَةِ الصُّفُوفِ وَإِقَامَتِهَا وَفَضْلِ الأَوَّلِ فَالأَوَّلِ مِنْهَا وَالاِزْدِحَامِ عَلَى الصَّفِّ الأَوَّلِ وَالْمُسَابَقَةِ إِلَيْهَا وَتَقْدِيمِ أُولِي الْفَضْلِ وَتَقْرِيبِهِمْ مِنَ الإِمَامِ
Sahih Muslim 436 b

Nu'man b. Bashir reported:

The Messenger of Allah (may peace-be upon him) used to straighten our rows as it lie were straightening an arrow with their help until be saw that we had learnt it from him. One day he came out, stood up (for prayer) and was about to say: Allah is the Greatest, when he saw a man, whose chest was bulging out from the row, so he said: Servants of Allah, you hint straighten your rows or Allah would create dissension amongst you.
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، أَخْبَرَنَا أَبُو خَيْثَمَةَ، عَنْ سِمَاكِ بْنِ حَرْبٍ، قَالَ سَمِعْتُ النُّعْمَانَ بْنَ بَشِيرٍ، يَقُولُ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُسَوِّي صُفُوفَنَا حَتَّى كَأَنَّمَا يُسَوِّي بِهَا الْقِدَاحَ حَتَّى رَأَى أَنَّا قَدْ عَقَلْنَا عَنْهُ ثُمَّ خَرَجَ يَوْمًا فَقَامَ حَتَّى كَادَ يُكَبِّرُ فَرَأَى رَجُلاً بَادِيًا صَدْرُهُ مِنَ الصَّفِّ فَقَالَ ‏ "‏ عِبَادَ اللَّهِ لَتُسَوُّنَّ صُفُوفَكُمْ أَوْ لَيُخَالِفَنَّ اللَّهُ بَيْنَ وُجُوهِكُمْ ‏"‏ ‏.‏
Reference : Sahih Muslim 436b
In-book reference : Book 4, Hadith 141
USC-MSA web (English) reference : Book 4, Hadith 875
  (deprecated numbering scheme)