If the liquid didn't move, it would kind of magically find itself OUTSIDE of the container. So yes, when you shake a container (move it with strong if short accelerations), the liquid inside will too move accordingly, being subject of the acceleration provided by the container (thru compression waves).
xigoi|2 years ago