John Gill's Bible Commentary Ver. 5. But take diligent heed to do the commandment and the law , etc.] The ten commandments, and all other laws, both ceremonial and civil: which Moses the servant of the Lord charged you ; in the name of the Lord, to keep and observe: to love the Lord your God ; of which keeping the commands of God is an evidence, and which is the true principle and motive of hearty, sincere, and cheerful obedience to them: and to walk in all his ways ; which he has prescribed, all his ways of worship, paths of duty, faith, truth, holiness, and righteousness: and to keep his commandments ; whether moral, ceremonial, or judicial: whether of natural and moral obligation, or of positive institution: and to cleave unto him ; and not depart from his ways, worship, word, and ordinances: and to serve him with all your heart, and with all your soul : in the most strict and affectionate manner. This advice Joshua thought proper to give them, and inculcate into them, now they were about to leave their brethren, and go on the other side Jordan; where they would be at a distance from the tabernacle, altar, and service of God, and might be under temptation to relinquish it, and set up another form of worship elsewhere.
Matthew Henry Commentary
Verses 1-9 - Joshua dismisses the tribes with good counsel. Those who have the commandment have it in vain, unless they do the commandment; and it will not be done aright unless we take diligent heed. In particular to love the Lord our God, as the best of beings, and the best of friends and as far as that principle rules in the heart, there will be constan care and endeavour to walk in his ways, even those that are narrow an up-hill. In every instance to keep his commandments. At all times, an in all conditions, with purpose of heart to cleave unto the Lord, an to serve him and his kingdom among men, with all our heart, and with all our soul. This good counsel is given to all; may God give us grac to take it!
Original Hebrew רק7535 שׁמרו8104 מאד3966 לעשׂות6213 את853 המצוה4687 ואת853 התורה8451 אשׁר834 צוה6680 אתכם853 משׁה4872 עבד5650 יהוה3068 לאהבה157 את853 יהוה3068 אלהיכם430 וללכת1980 בכל3605 דרכיו1870 ולשׁמר8104 מצותיו4687 ולדבקה1692 בו ולעבדו5647 בכל3605 לבבכם3824 ובכל3605 נפשׁכם׃5315