In order to achieve linear motion from compressed air, a system of pistons is most commonly used.  The compressed air is fed into an air-tight chamber that houses the shaft of the piston.  Also inside this chamber a spring is coiled around the shaft of the piston in order to hold the chamber completely open when air is not being pumped into the chamber.  As air is fed into the chamber the force on the piston shaft begins to overcome the force being exerted on the spring. As more air is fed into the chamber, the pressure increases and the piston begins to move down the chamber. When it reaches its maximum length the air pressure is released from the chamber and the spring completes the cycle by closing off the chamber to return to its original position. 
Piston motors are the most commonly used in hydraulic systems. Essentially, piston motors are the same as hydraulic motors except they are used to convert hydraulic energy into mechanical energy.
Piston motors are often used in series of two, three, four, five, or six cylinders that are enclosed in a housing.  This allows for more power to be delivered by the pistons because several motors are in sync with each other at certain times of their cycle.
The practical mechanical efficiencies attained by a piston air motor are between 40–50%.