Sunan Abi Dawud, Hadith 662

Al-Nu’man b. Bashir said: the Messenger of Allah paid attention to the people and said three times; straighten your rows (in prayer); by Allah, you must straighten your rows, or Allah will certainly put your faces in contrary directions. I then saw that every person stood in prayer keeping his shoulder close to that of the other, and his knee close to that of the other, and his ankle close to that of the other.

حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا وَكِيعٌ، عَنْ زَكَرِيَّا بْنِ أَبِي زَائِدَةَ، عَنْ أَبِي الْقَاسِمِ الْجَدَلِيِّ، قَالَ سَمِعْتُ النُّعْمَانَ بْنَ بَشِيرٍ، يَقُولُ أَقْبَلَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَلَى النَّاسِ بِوَجْهِهِ فَقَالَ ‏"‏ أَقِيمُوا صُفُوفَكُمْ ‏"‏ ‏.‏ ثَلاَثًا ‏"‏ وَاللَّهِ لَتُقِيمُنَّ صُفُوفَكُمْ أَوْ لَيُخَالِفَنَّ اللَّهُ بَيْنَ قُلُوبِكُمْ ‏"‏ ‏.‏ قَالَ فَرَأَيْتُ الرَّجُلَ يُلْزِقُ مَنْكِبَهُ بِمَنْكِبِ صَاحِبِهِ وَرُكْبَتَهُ بِرُكْبَةِ صَاحِبِهِ وَكَعْبَهُ بِكَعْبِهِ ‏.‏

sunnah.com