Abdullah bin Umar reported,

The Messenger of Allah ﷺ said, "Whoever among you is able to be like the man with the measure of rice, let him be like him."They asked, "Messenger of Allah, who is the man with the measure of rice?"He said, "Three men set out, and the sky clouded over them, so they entered a cave. Then a boulder came down from the top of the mountain and sealed the entrance upon them. They struggled with it but could not move it. So they said to one another, 'You have fallen into a terrible situation. Let each man pray by mentioning the best deed he has ever done. Perhaps Allah Most High will deliver us from this.'"One of them said, 'O Allah, You know that I had two elderly parents. I used to milk their milk for them and come to them, but they would already be asleep. So I would spend the night standing with their milk in my hands, unwilling to give it to anyone before them, and unwilling to wake them from their sleep, while my little children whimpered with hunger around me. If You know that I did this only out of fear of You, then relieve us.' The boulder shifted."The second said, 'O Allah, You know that I had a cousin, and nothing You created was dearer to me than she was. I asked her for herself, and she said, "No, by Allah, not for less than a hundred dinar." So I gathered the money and handed it to her. But when I sat with her as a man sits with his wife, she said, "Fear Allah, and do not break the seal except by its right." So I got up and left her. If You know that I did this only out of fear of You, then relieve us.' The boulder moved back until the sky became visible."The third said, 'O Allah, You know that I once hired a laborer for a measure of rice. When evening came I offered him his wage, but he refused to take it and went off, leaving it with me. I felt uneasy about keeping it, so I invested it for him and made it grow, until I bought cattle and a herdsman with it. After some time he met me and said, "Fear Allah, give me my wage, and do not wrong me." I said, "Go to those cattle and their herdsman and take them." He said, "Fear Allah, and do not mock me." I said, "I am not mocking you." So he went and drove them all away. If You know that I did this only seeking Your pleasure and out of fear of You, then relieve us.' Then the boulder rolled away, and they walked out."

Ahmad 5974

Sahih

حدثنا يعقوب حدثنا أبي عن صالح حدثنا نافع أن عبد الله بن عمر قال قال رسول الله ﷺ بينما ثلاثة رهط يتماشون أخذهم المطر فأووا إلى غار في جبل فبينما هم فيه حطت صخرة من الجبل فأطبقت عليهم فذكر الحديث مثل معناه

أحمد 5974صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abdullah bin Umar
Numbering
Darussalam 5974
Ahmad 5974