ENOfficial
Ibn ‘Umar said the Prophet (ﷺ) ordered dogs to be killed, except hunting dogs or sheepdogs or dogs used for looking after animals. (Bukhari and Muslim.)
Source: sunnah.com
Other translations
Arabic
وَعَنِ ابْنِ عُمَرَ أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ أَمَرَ بِقَتْلِ الْكِلَابِ إِلَّا كَلْبَ صيدٍ أَو كلب غنم أَو مَاشِيَة
sunnah.com