Switching cathode

Either you arent understanding my question, or Im not understating your answer. I know how to set the anodes of LED's to high to turn them on when they share a common ground. But in this case each digit shares anodes and is separated by using separate cathodes. So along with setting an output pin to apply charge to the anodes of the segments, I also need to know how to switch the ground on and off between the 5 cathodes to change between digits.

edit- okay I see the confusion. I know which cathodes control what... I need to know how to actually set the cathodes.