The shear of a vector field F is
Thus, in 3 dimensions, the shear is a 3 x 3 tensor.
Global magnetic shear
In the context of magnetic confinement, and assuming the existence of toroidally nested magnetic flux surfaces, the only relevant variation of the direction of the magnetic field is the radial gradient of the rotational transform. The global magnetic shear is defined as
High values of magnetic shear provide stability, since the radial extension of helically resonant modes is reduced. Negative shear also provides stability, possibly because convective cells, generated by curvature-driven instabilities, are sheared apart as the field lines twist around the torus. 
Local magnetic shear
The local magnetic shear is defined as