Israel was much more involved in trade than just sheep herders. There were several cheap and available methods to write by. Waxed wood, silver or copper plates and using iron or flint to inscribe, paper made from papyrus reed, and even animal hides. Walls and plaster was another common place writings were placed upon. There was the cheap stones as well.
There was also besides a common ability to read and write was the Scribes the professional writers of legal writs etc. Hebrew existed as a written language 1400 BC. My source on this? The Revell Bible Dictionary under the heading of writing. Just because there were professional Scribes doesn't mean common man could not read or write.
God commanded an Israelite man who was divorcing his wife to give her a WRITTEN certificate of divorce.
I guess God didn’t know that all those Israelites were supposed to be illiterate.....