Ubuntu – How to switch from GUI to CLI mode and terminate any GUI program

command linegui

I am using Ubuntu 13.04 64-bit. I need to perform some database benchmarks on my computer so I want to make it in strict terminal mode, without desktop. I know I can ctrl-alt-f1 to go to terminal mode, but there is still graphical desktop running in background. (Using CPU and RAM which I do not want it to).

So please help me to kill all graphical components and switch to only terminal mode (for better performance). I will not need multiple users to be able to log in and do not need to have networking (all benchmarks will be on localhost interface).

Best Answer

The command below will stop the graphical interface. The next one will restart it for you (everything will be reset as if you had restarted your computer).

sudo service lightdm stop
sudo service lightdm start

This works for Unity, I don't know for sure if it works on Gnome desktop.

Related Question