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

Is It possible In Linux to restart only gui session or os ( i m not talking about restarting pc )

back in windows 98 if u want to restart the gui session or only os u just need to hold down shift key and it will restart the your gui session or only os & it work fine

windows 98 shift + restart

share|improve this question
up vote 35 down vote accepted

Yes. There a couple of options.

1) You can enable CTRL+SHIFT+BACKSPACE. This three keys will work like CTRL+ALT+SUPR, but they will only restart the GUI.

2) From the command line (press CTRL+ALT+F1 to get to a console) you can restart the Ubuntu display manager (which lets a user login to her preferred GUI) by entering:

sudo service lightdm restart

3) Finally you can restart just unity. It will reset your GUI (all the windows and the bars), but it will not kill any program. After the restart you can continue working where you left it. Enter:

unity --replace

or if you are restarting from the console (after pressing CTRL+ALT+F1), enter:

DISPLAY=:0 unity --replace
share|improve this answer
Why do you run Unity with sudo? – Andrey Vihrov Feb 4 '12 at 8:47
a) You don't need to switch to a tty to restart the GUI, you can do it from within a graphical terminal just fine. – popey Feb 4 '12 at 9:15
b) We used lightdm these days, so 'sudo service lightdm restart' would be more accurate – popey Feb 4 '12 at 9:16
@popey: I expect that he want's to restart the GUI because it's unresponsive. That also means that unity --replace should have a DISPLAY=:0 if you need to do it from the console. – Javier Rivera Feb 4 '12 at 19:28
Thank to both if you, very useful comments. – Javier Rivera Feb 4 '12 at 19:30

Traditionally this was accomplished in linux by using ctrl + alt + backspace. This has been disabled a few releases ago and it used to be easily enabled (with the dontzap package).

Nowdays I restart X by using the console and type:

sudo killall Xorg

Then the GUI will restart and you'll get back to your login manager. Make sure to save everything first.

share|improve this answer
FYI, if you didn't know: The last few versions have made it easy to enable that key combination in the keyboard layout options (currently in "system settings" -> "keyboard layout" -> "layouts" -> "options..." -> "Key sequence to kill the X server"). – Marty Fried Feb 7 '12 at 20:36

To restart your graphical session, log out and log back in.

If the system is frozen, you can use Ctrl-alt-backspace to log you out (kill your applications).

To do that , see which gives you a nice graphical walk through.

If you simply want to restart the window manager, without logging out, it depends on the window manager.

For Unity see

Restart window manager

For gnome you hit Alt + F2 and in the dialog enter r and Enter

share|improve this answer

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.