Abu Dharr said, "I was walking with the Prophet ﷺ in the lava plain of Medina when Mount Uhud came into view before us."The Prophet ﷺ said, "Abu Dharr?"I replied, "At your service, Messenger of Allah."He said, "It would not please me to possess gold equal to this Uhud, with three nights passing while I still had a single dinar of it left, except something I set aside for a debt, unless I were to spend it among the servants of Allah like this, and like this, and like this," gesturing to his right, his left, and behind him.Then he walked on and said, "Those who have the most will be the ones with the least on the Day of Resurrection, except for one who spends like this, and like this, and like this," gesturing to his right, his left, and behind him, "and they are few." The hadith continues.
قال أبو ذر: كنت أمشي مع النبي ﷺ في حرة المدينة فاستقبلنا أحد، فقال: يا أبا ذر؟ قلت: لبيك يا رسول الله قال: ما يسرني أن عندي مثل أحد هذا ذهبا، تمضي علي ثالثة وعندي منه دينار، إلا شيئا أرصده لدين، إلا أن أقول به في عباد الله هكذا وهكذا وهكذا عن يمينه وعن شماله ومن خلفه، ثم مشى فقال: إن الأكثرين هم الأقلون يوم القيامة إلا من قال هكذا وهكذا وهكذا- عن يمينه وعن شماله ومن خلفه- وقليل ما هم… الحديث.
Bukhari narrated it in Riqaq (6444), and Muslim narrated it in Zakat (94), both of them through Amash, from Zayd bin Wahb, who said, Abu Dharr said, and then he mentioned it. The wording given here is Bukhari's.