Exodus 3:5
3 So Moses thought, “I will turn aside to see this amazing sight. Why does the bush not burn up?” 4 When the Lord saw that he had turned aside to look, God called to him from within the bush and said, “Moses, Moses!” And Moses said, “Here I am.” 5 God said, “Do not approach any closer! Take your sandals off your feet, for the place where you are standing is holy ground.” 6 He added, “I am the God of your father, the God of Abraham, the God of Isaac, and the God of Jacob.” Then Moses hid his face, because he was afraid to look at God. 7 The Lord said, “I have surely seen the affliction of my people who are in Egypt. I have heard their cry because of their taskmasters, for I know their sorrows.
Joshua 5:15
13 When Joshua was near Jericho, he looked up and saw a man standing in front of him holding a drawn sword. Joshua approached him and asked him, “Are you on our side or allied with our enemies?” 14 He answered, “Truly I am the commander of the Lord’s army. Now I have arrived!” Joshua bowed down with his face to the ground and asked, “What does my master want to say to his servant?” 15 The commander of the Lord’s army answered Joshua, “Remove your sandals from your feet because the place where you stand is holy.” Joshua did so.
Notes and References
"... Exodus 3:1-4 probably likewise combines Yahwistic and Elohistic descriptions of Moses' encounter with God. Exodus 3:5-6a is equally difficult. Verse 6 is probably Elohistic, since it refers to 'the Deity' and the fear of God. Verse 5, however, is Yahwistic by Friedman's theory of the Greater J since it is repeated almost verbatim in Joshua 5:15. Fuss and Weimar, feeling a contradiction between the two commands in verse 5, hypercritically divide the verse between authors; but surely the sense is 'Do not approach hither until you have pulled your sandals ...' ..."
Propp, William Henry Exodus 1-18: A New Translation with Introduction and Commentary (p. 192) Doubleday, 1999