Linux Runlevels

To quickly switch from GUI to shell-only runlevel, enter the following:

sudo /sbin/init 3    # switch to shell with networking 
sudo /sbin/init 5    # switch back to GUI

To set the default runlevel in CentOS, edit file /etc/inittab (set line id:3:initdefault: to the correct value).