The learned Torah the entire time.
Forty years (Numbers ch.14)
The book of exodus tells us about the wandering for 40 years.
It was the forty-year period (Numbers ch.14) that the Israelites spent in the wilderness before entering Canaan.
The trip could have been done in a month.
Deuteronomy 29:4, "I have led you in the wilderness for forty years".
During the Israelites' sojourn in the wilderness, the Tabernacle was moved forty-two times (Numbers ch.33).
According to the Old Testament, the Israelites (the ancestors of today's Jews) wandered the wilderness (often mistranslated as desert) for 40 years. There is currently no archaeological evidence to support the claim that this event actually happened historically (see also the attached Related Link.).
The birds that the Israelites ate (Exodus ch.16, Numbers ch.11) is translated as quail. They ate the quail for two brief periods, not for the whole forty years.
God cursed the Israelites to wander the wilderness for 40 years as a consequence of their lack of faith and disobedience. This period served as a time of purification and repentance for the Israelites before entering the promised land.
The Israelites journeyed into the wilderness of Shur (Exodus ch.15).
They journeyed and encamped in the wilderness for forty years (Numbers ch.14), at the guidance of God (Numbers ch.9).