Positive commandment · Mitzvat Aseh #193 of 613
To prepare a shovel [to cover one's excrement]
להתקין יתד
The verse · Devarim 23:14
וְיָתֵד תִּהְיֶה לְךָ עַל־אֲזֵנֶךָ וְהָיָה בְּשִׁבְתְּךָ חוּץ וְחָפַרְתָּה בָהּ וְשַׁבְתָּ וְכִסִּיתָ אֶת־צֵאָתֶךָ
“and thou shalt have a spade among thy weapons, and it shall be, when thou wilt ease thyself outside, thou shalt dig with it, and shalt turn back and cover thy excrement:”
The Rambam’s words
To prepare a shovel [to cover one's excrement], as [Deuteronomy 23:14] states: "You shall have a shovel in addition to your weapons."
להתקין יתד, שנאמר: "ויתד תהיה לך, על אזנך" (דברים כג,יד).
Why · Sefer HaChinuch #567
Set up a spike to dig with
“And the root of this commandment and all of its content is in the commandment that is before it.”
Where in the Mishneh Torah
Hilchot Kings and Wars הלכות מלכים ומלחמות