Two Years Before the Mast is a true record of the author Richard Henry Dana, Jr.'s experiences when he worked as an ordinary seaman on a sailing vessel named the Pilgrim and aboard a different sailing vessel, the Alert, on his return from California to Massachusetts. Both ships were involved in a single trading voyage, bringing manufactured goods from Boston and returning to Massachusetts with a cargo of cow hides, where they could be turned into luggage, shoes, and other leather goods. The "two years" were from 1834 to 1836, and in those days there was very little in California to trade for the manufactured goods brought from Boston except cow hides. The Pilgrim stopped at small ports all along the California coast. These little ports have all become major cities--San Diego, Los Angeles, Santa Barbara, Monterey, and San Francisco.
In those days, ships from the East Coast had to sail all the way down the Atlantic to the southern tip of South America, around the turbulent Cape Horn, and back up the west coast of South America and Central America to California. That explains why the voyage took so long.
The hardest work the sailors had to do was loading cow hides aboard their ship. Since the ports were primitive, the men often had to carry stacks of cow hides from the shore out to the ship in waist-high surf. Dana wrote the book mainly to show how badly the sailors were treated aboard ships. He was a gentleman-adventurer himself, taking time off from his studies at Harvard College.