In P or compressional waves, the vibration of the rock is in the direction of propagation.
P waves travel fastest and are the first to arrive from the earthquake.
In S or shear waves, rock oscillates perpendicular to the direction of wave propagation. For example, sound waves are P waves at a high enough frequency to hear with your ear. An example of an S wave is wiggling or shaking a rope which is tied down at one or both ends. Both P and S waves travel outward from an earthquake focus inside the earth. The waves are often seen as separate arrivals recorded on seismographs at large distances from the earthquake.