Language:
كتاب الأدب
78  
Good Manners and Form (Al-Adab)
(20)
Chapter: Killing of children for the fear that they will share meals (in the book an 's' is added to shares I have omitted that 's')
(20)
باب قَتْلِ الْوَلَدِ خَشْيَةَ أَنْ يَأْكُلَ مَعَهُ
Sahih al-Bukhari 6001

Narrated `Abdullah:

I said 'O Allah's Messenger (ﷺ)! Which sin is the greatest?" He said, "To set up a rival unto Allah, though He Alone created you." I said, "What next?" He said, "To kill your son lest he should share your food with you." I further asked, "What next?" He said, "To commit illegal sexual intercourse with the wife of your neighbor." And then Allah revealed as proof of the statement of the Prophet: 'Those who invoke not with Allah any other god)................. (to end of verse)...' (25.68)

حَدَّثَنَا مُحَمَّدُ بْنُ كَثِيرٍ، أَخْبَرَنَا سُفْيَانُ، عَنْ مَنْصُورٍ، عَنْ أَبِي وَائِلٍ، عَنْ عَمْرِو بْنِ شُرَحْبِيلَ، عَنْ عَبْدِ اللَّهِ، قَالَ قُلْتُ يَا رَسُولَ اللَّهِ أَىُّ الذَّنْبِ أَعْظَمُ قَالَ ‏"‏ أَنْ تَجْعَلَ لِلَّهِ نِدًّا وَهْوَ خَلَقَكَ ‏"‏‏.‏ ثُمَّ قَالَ أَىُّ قَالَ ‏"‏ أَنْ تَقْتُلَ وَلَدَكَ خَشْيَةَ أَنْ يَأْكُلَ مَعَكَ ‏"‏‏.‏ قَالَ ثُمَّ أَىُّ قَالَ ‏"‏ أَنْ تُزَانِيَ حَلِيلَةَ جَارِكَ ‏"‏‏.‏ وَأَنْزَلَ اللَّهُ تَصْدِيقَ قَوْلِ النَّبِيِّ صلى الله عليه وسلم ‏{‏وَالَّذِينَ لاَ يَدْعُونَ مَعَ اللَّهِ إِلَهًا آخَرَ‏}‏‏.‏
Reference : Sahih al-Bukhari 6001
In-book reference : Book 78, Hadith 32
USC-MSA web (English) reference : Vol. 8, Book 73, Hadith 30
  (deprecated numbering scheme)