Abdullah bin Umar reported,

The Messenger of Allah ﷺ ordered that dogs be killed, except for a hunting dog or a dog used for guarding sheep or livestock.It was said to Ibn Umar, "Abu Hurairah also mentions a dog used for guarding crops."Ibn Umar replied, "Abu Hurairah has crops."

Muslim 4019

Sahih

حدثنا يحيى بن يحيى أخبرنا حماد بن زيد عن عمرو بن دينار

عن ابن عمر

أن رسول الله ﷺ أمر بقتل الكلاب إلا كلب صيد أو كلب غنم أو ماشية فقيل لابن عمر إن أبا هريرة يقول أو كلب زرع فقال ابن عمر إن لأبي هريرة زرعا

مسلم 4019صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Sharecropping of orchards
Chapter
Command to kill dogs, its abrogation, and the prohibition of keeping them except for hunting, farming, livestock, and similar purposes
Numbering
Darussalam 4019
Muslim 4019