You have a couple of options here. First, when you're in X, type man shutdown to find out about how to use shutdown. The 2 basic commands you need are:
shutdown -h now
** this will shutdown.
shutdown -r now
** this will restart.
Or, if you don't want to restart (like if you've run fsck -y a few times until your disk comes up clean and you just want to go to X) type logout and the multiuser boot will continue.