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