Abu Masud Uqba bin Amr reported,

The Messenger of Allah ﷺ used to pass his hand over our shoulders and say, "Straighten your rows and do not differ, lest your hearts differ. Let those of maturity and understanding stand closest to me, then those who follow them, then those who follow them."

Nasai 813

Sahih

أخبرنا بشر بن خالد العسكري قال حدثنا غندر عن شعبة عن سليمان عن عمارة بن عمير عن أبي معمر

عن أبي مسعود قال

كان رسول الله ﷺ يمسح عواتقنا ويقول استووا ولا تختلفوا فتختلف قلوبكم وليليني منكم أولو الأحلام والنهى ثم الذين يلونهم ثم الذين يلونهم

النسائي 813صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Leadership
Chapter
What the imam says when stepping forward to straighten the rows
Numbering
Darussalam 813
Nasai 813