In the US, lockstep marching or simply lockstep is marching in a very close single file in such a way that the leg of each person in the file moves in the same way and at the same time as the corresponding leg of the person immediately in front of him, so that their legs stay very close all the time.
Originally it was used in drilling soldiers. Each soldier stepped on the point just vacated by the foot of the soldier in front of him. Thus the soldiers stayed in position to form close files.
Lockstep marching was a characteristic trait of American prisons of the 19th century. "Inmates formed in single file, right hand on the shoulder of the man in front, left hand on the side; the convicts then stepped off in unison, raising the right foot high and shuffling with the left." The reason for the shuffling step was the chain that connected the legs of a chain gang.
In the Auburn Prison, John Cray developed the following form of the lockstep, as part of the penal system that has become known as the Auburn system, developed in the 1820s: "The lockstep was a method of walking where each man walked with his arms locked under the man's arms in front of him". This system was devised to keep prisoners under control during mass marches of several hundred prisoners from work places to mess, to cells, several times a day. Also, the inmates in lockstep were often required to alternate which side they were looking toward, to preclude communication.
The Auburn system, including its lockstep, was also adopted in Canada.
In some prisons, the inmates were divided into categories, with some of them walking in an ordinary military step, while lockstep was applied to others as a form of punishment.
In Nazi Germany, members of the Hitler Youth were also made to march in lockstep.
Along with striped robes and enforced silence, the prison lockstep was criticized as dehumanizing until it was abolished by the early 1900s.
The term acquired a number of other meanings by the way of analogy, referring to synchronous or imitating movement or other behavior, following something or someone ("in lockstep with..."), often with a pejorative tone.