Every soldier was to keep a digging instrument among his weapons in order to dig a hole for his excrement. The reason for this is what we said in the previous mitzvah: to keep the camp physically clean and suitable to host God’s metaphorical “presence.”
The word for “your weapons” in our verse is azeinecha. The Talmud (Kesubos 5b) homiletically reads that word as aznecha (“your ears”) in order to deliver the moral lesson that when confronted with gossip or slander, a person should stick his fingers in his ears.
This mitzvah applies in Temple times. It is discussed in the Midrash in the Sifre and is codified in the Mishneh Torah in the sixth chapter of Hilchos Melachim. This mitzvah is #193 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos.