A man asked the Prophet ﷺ, "Which deeds are best?"He replied, "That you feed others and offer the greeting of peace to those you know and those you do not know."
حدثنا حجاج وأبو النضر قالا حدثنا ليث حدثني يزيد بن أبي حبيب عن أبي الخير
أن رجلا سأل النبي ﷺ أي الأعمال خير قال أن تطعم الطعام وتقرأ السلام على من عرفت ومن لم تعرف
Its isnad is sahih. Hajjaj is Ibn Muhammad Masissi. Abu Nadr is Hashim bin Qasim. Layth is Ibn Saad.Abu Khayr is Marthad bin Abdullah Yazani, the Successor. We have already confirmed his reliability at 785, and we add here that Bukhari gave his biography in Kabir 4/1/416, and Ibn Saad in Tabaqat 7/2/200.The hadith was narrated by Bukhari 1/52-53, 7 and 11/18, Muslim 1/28, Abu Dawud 5194 (Awn al-Mabud 4/516), Nasai 2/268, Ibn Majah 2/156, and Bukhari also in Adab al-Mufrad 149-154, Abu Naeem in Hilyah 1/287, and Khatib in Tarikh Baghdad 8/169, all of them through the route of Layth bin Saad, with this isnad.In all of their narrations it reads, "Which act of Islam is best?" Likewise, in all of them the wording is "tut'im" without the infinitive particle "an." Hafiz said in 1/53, "It is understood as if the infinitive were present, meaning 'an tut'im' (that you feed), similar to the saying 'tasma bi-al-Muidi' (hearing of al-Muidi is better than seeing him)." So it appears that Hafiz had not come across this narration in the Musnad when he wrote that.