I am running Ubuntu Server with the Xfce desktop environment install.
I have to type startx to get to the GUI. How can I get back into the command line interface when I am in the GUI without rebooting.

  • 1
    For clarity, are you just wanting to access the command line, or are you wanting to quit your X session? Jun 14, 2017 at 21:06

1 Answer 1


You can change your tty and there are several ways to do that, e.g:

sudo chvt 2

Will put you in tty2.

or Ctrl+Alt+F2.

use ps $(pgrep X) command to see in which tty your X session is running, and use another.

You can also kill the X session which is not a good idea, or change the target to multiuser.target.

Alternatively you might want to stop xfce4-session:

sudo pkill -15 xfce4-session

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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