Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know about startx, but is there a command that stops X? I run Ubuntu 10.04.

share|improve this question
up vote 4 down vote accepted

X is currently handled by gdm (Gnome Display Manager). The "proper" way for starting, stopping and restarting the graphical server is:

sudo stop gdm
sudo start gdm
sudo restart gdm

Commands like startx aren't recommended as they're not setting important environment variables or neccessarily pulling in the right configuration. Using startx instead of gdm also makes it harder to close ;)

share|improve this answer
If gdm is used. Otherwise substitute gdm with kdm (in case of Kubuntu) – txwikinger May 17 '11 at 17:51
I use kdm. Thanks for the help, now I don't need to use a GUI all the time! – Ryan Hoots May 17 '11 at 18:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.