Moses: the Ten Commandments
As leader of the Israelites during the forty years between their leaving Egypt and their reaching the promised land of Canaan, Moses faced many difficulties, among them the necessity of ensuring an adequate supply of food and water for a large number of people in inhospitable terrain, and the hostility of some of the tribes through whose territory the Israelites travelled and with whom they sometimes had to do battle - for more detail see Moses: the Years in the Wilderness. No less vital, however, was the need to prevent disorder and promote social harmony amongst the Israelites themselves - as in any large group, some Israelites behaved badly, harming or offending others, and disputes arose between different individuals. Moses initially assumed responsibility for dealing with these matters, but soon found that these judicial functions consumed a great deal of his time.
Within months of leaving Egypt the Israelites were in the area around Mount Horeb, where Moses in his youth had worked as a shepherd (see Moses: the Early Years) and where his father-in-law Jethro still lived. Jethro came to see Moses, and was appalled that Moses was obliged to spend so much of his time listening to the Israelites' complaints about their neighbours' misbehaviour and resolving disputes between them. He realised that Moses could not sustain this workload indefinitely (ibid. ch. 18, vv. 13-18), and gave him two good pieces of advice: first, that he should formulate and inculcate in the Israelites certain general moral principles or 'laws' to govern their behaviour (ibid. ch. 18, v. 20: 'thou shalt teach them ordinances and laws, and shalt show them the way wherein they must walk, and the work that they must do'); and secondly, that he should delegate most of the day-to-day business of listening to complaints and resolving disputes so that only the most important matters required his attention (ibid. ch. 18, vv. 21-22: 'thou shalt provide ... able men ... ; and place such over < the Israelites> to be rulers of thousands, and rulers of hundreds, and rulers of fifties, and rulers of tens; and let them judge the people at all seasons: and it shall be that every great matter they shall bring unto thee, but every small matter they shall judge ...'). It is against this background that the Ten Commandments were communicated to Moses on Mount Sinai. (Mount Sinai is thought by many scholars to be simply another name for Mount Horeb).
After Jethro left (ibid. ch. 18, v. 27), Moses called the Israelites together and obtained from them a promise to obey whatever commandments God communicated to him. At the same time he gave them an assurance that if they obeyed these commandments God would view them with special favour (ibid. ch. 19, vv. 1-8). He then ordered them to carry out ceremonies of ritual purification to prepare themselves to receive these commandments, and to assemble at the foot of Mount Sinai (ibid. ch. 19, vv. 9-15). When the Israelites assembled there two days later, there was thunder and lightning, Mount Sinai itself was hidden in a thick cloud of smoke, and they heard the sound of a trumpet, which grew louder and louder (ibid. ch. 19, vv. 16-25). Moses went up to the top of the mountain, and there God communicated to him the principles or 'laws' which were to govern the Israelites' behaviour. It is these principles which have come to be known as the Ten Commandments - for more information about them see the Ten Commandments. (In fact what God communicated to Moses on Mount Sinai went far beyond the Ten Commandments: it included, for example, detailed instructions about the kinds of sacrifice that were acceptable, and the kinds of punishment appropriate to different kinds of wrongdoing.) When Moses came down from Mount Sinai he wrote out the Ten Commandments, and in a solemn ceremony made the Israelites swear that they would obey them (ibid. ch. 24, vv. 3-8). According to alternative biblical accounts - see Exodus ch. 31, v. 18 and Deuteronomy ch. 5, v. 22 - God himself wrote the commandments on two tables of stone, which Moses brought down from Mount Sinai.
For information about the final part of Moses' life see Moses: the Years in the Wilderness.