as stated, you only wanna do this, GENTLY, if fermentation appears to get stuck. gently stir or swirl the fermenter to resuspend yeast.
if you shake it you add air, which means oxidation, which yields stale beer flavors pretty quickly (but not instantly)