It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that after the iqamah and before saying the takbir, the Messenger of Allah (peace and blessings be upon him) would turn towards the Companions (may Allah be pleased with them) and say: "Straighten (level) your rows and stand close together, for I see you from behind my back." Anas (may Allah be pleased with him) said: I saw that every man, when he stood for the prayer, would join his shoulder to the shoulder of his brother.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2288
Sayyiduna Anas bin Malik (may Allah be pleased with him) said that after the iqamah, the Messenger of Allah (peace and blessings be upon him) turned towards us and said: "Straighten your rows and stand close together with one another. I see you from behind my back."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2289
It is narrated from Simak bin Harb that he said: I heard Nu'man bin Bashir (may Allah be pleased with him) saying that the Messenger of Allah (peace and blessings be upon him) used to straighten our rows as though he were straightening arrows with them, until he was sure that we had learned it from him. Then one day the Messenger of Allah (peace and blessings be upon him) stood for the prayer, and he was just about to say the takbir when his gaze suddenly fell on a man whose chest was sticking out from the row. He (peace and blessings be upon him) said: "O servants of Allah, you must keep your rows straight, or else the Lord will turn your faces awry."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2290
It is narrated from Simak (may Allah have mercy on him) that he said: I heard Sayyiduna Nu'man bin Bashir (may Allah be pleased with him) saying that when we stood for the prayer, the Messenger of Allah (peace and blessings be upon him) would level our rows, and when we had become straight, then he (peace and blessings be upon him) would say the takbir.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2291
It is narrated from Nafi' (may Allah have mercy on him) that Sayyiduna Umar bin al-Khattab (may Allah be pleased with him) used to order that the rows be levelled (that is, he would assign some men the duty of straightening the rows), and when those men came and informed him that the rows had become straight, then he would say the takbir.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2292
Abu Suhayl bin Malik narrates from his father that he said: I was with Uthman bin Affan (may Allah be pleased with him). The iqamah was called while I was talking to him about my share (a stipend to be assigned to me). I kept talking to him while he was levelling the pebbles with his sandals, until some men whom he had appointed to straighten the rows came to him and informed him that the rows had been straightened. Then he said to me: "Get straight in the row," and then he said the takbir.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2293