
längs
along
Used as a preposition to describe movement or orientation parallel to the longer side of something; along.
Wir spazierten längs des Flusses.
We walked along the river.
along / lengthwise
Loading your saved state.

along
Used as a preposition to describe movement or orientation parallel to the longer side of something; along.
Wir spazierten längs des Flusses.
We walked along the river.

lengthwise
Used as an adverb to indicate that something happens or is arranged in the lengthwise direction.
Bitte schneide das Baguette längs und nicht quer durch.
Please cut the baguette lengthwise and not crosswise.
The word 'längs' (along/lengthwise) is derived directly from the adjective 'lang' (long). It describes an orientation that follows the length of something.
Der Radweg führt längs der Hauptstraße.
The bike path runs along the main road.
You can tell whether 'längs' (along/lengthwise) is a preposition or an adverb from the sentence structure. If it stands before a noun, e.g. 'längs des Weges' (along the path), it is a preposition. If it stands alone and describes an action, e.g. 'etwas längs schneiden' (to cut something lengthwise), it is an adverb.
Wir sind längs der Küste gewandert.
We hiked along the coast.
As a preposition, 'längs' (along) takes the genitive in standard German. In colloquial speech, however, the dative is very often used.
Längs des Zaunes wachsen viele Blumen.
Many flowers grow along the fence.
As an adverb, 'längs' (lengthwise) is often used in instructions to describe the direction of an action. Common verbs are 'schneiden' (to cut), 'falten' (to fold), or 'teilen' (to divide).
Der Tischler sägte das Brett längs durch.
The carpenter sawed the board lengthwise.
along
Entlang and längs can describe movement parallel to a path or river. In everyday language, entlang is the neutral and more common choice, while längs sounds more formal and less common and can emphasize the longitudinal direction more strongly. In normal conversations, entlang is therefore usually the better choice.

Das Boot fuhr längs des Flusses.
The boat traveled along the river.
Wir gingen den Fluss entlang.
We walked along the river.