According to Daniel Cassidy in his ridiculous work of fake etymology, How The Irish Invented Slang, the origins of the word longshoreman lie in the Irish language. The International Longshore and Warehouse Union disagrees with him. According to their website:
“The origins of the ILWU lie in the longshore industry of the Pacific Coast – the work of loading and unloading ships’ cargoes. In the old days of clipper ships, sailings were frequently unscheduled and labor was often recruited at the last minute by shoreside criers calling: “Men along the shore!” – giving rise to the term “longshoremen.” The work was brutal, conditions unsafe, employment irregular, and the pay too low to support a family.”
According to Daniel Cassidy, who probably never did an honest day’s work in his life, the word longshoreman comes from the Irish loingseoir, which is one word (along with mairnéalach, maraí, farraigeach and seoltóir) for sailor. It is pronounced lingshore. Why the lubbers along the docks would be called sailors when they unloaded cargoes is difficult to explain but then almost nothing Cassidy wrote stands up to any scrutiny at all. It’s all ballyhoo and no bally substance.