How can I restart X Window Server from the command line?
I'd really like to be able to restart my GUI without having to do a full system reboot.
command linexorg
How can I restart X Window Server from the command line?
I'd really like to be able to restart my GUI without having to do a full system reboot.
Best Answer
NOTE: This will forcefully quit all graphical programs, you'll lose any unsaved work, and you'll be logged out. Non-graphical programs will not be affected.
TL;DR: on systems with systemd (Ubuntu 15.04 and newer)
This will restart the appropriate display manager service (
lightdm
till 17.04,gdm3
after,sddm
in Kubuntu, etc.). You can replacedisplay-manager
withlightdm
,gdm3
,sddm
, etc. if needed, but this should be enough.For other Ubuntu versions, first find which display manager your ubuntu is having with following command:
Than depending on what display manager, you can use one of the following commands:
Default Ubuntu (with LightDM)
Gnome (with GDM)
KDE (with KDM)
Note: From 12.10 to 15.04, Kubuntu also uses LightDM.
For MDM (e.g. for Mint Cinnamon)