The authors propose a new method, the Helfand-moment method, to compute the shear viscosity by equilibrium molecular dynamics in periodic systems. In this method, the shear viscosity is written as an Einstein-type relation in terms of the variance of the so-called Helfand moment. This quantity is modified in order to satisfy systems with periodic boundary conditions usually considered in molecular dynamics. They calculate the shear viscosity in the Lennard-Jones fluid near the triple point thanks to this new technique. They show that the results of the Helfand-moment method are in excellent agreement with the results of the standard Green-Kubo method. (C) 2007 American Institute of Physics.