Page 1 of 1

ubuntu : turn off screen

Posted: Mon Jan 27, 2020 11:24 am
by Stevyn
https://askubuntu.com/questions/62858/t ... mmand-line

by Boy Graffity

I've just installed Ubuntu Server 18.04.1 (no GUI, X, nor anything graphical), and after breaking my back last night trying to turn off the screen I finally found the magic command:

Code: Select all

setterm --blank 1
After executing the command the screen will turn off automatically every minute (if idle).

And even better, if you want the command to be executed automatically at boot, you can add it to the GRUB commandline, to do so we have to edit the next file:

Code: Select all

sudo nano /etc/default/grub
Once there, just add consoleblank=60 to GRUB_CMDLINE_DEFAULT, it should look like this:

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=60"
Then close the file and save it, after that just run sudo update-grub and voila, every time you boot the screen will turn off automatically every 60 sec. (again, if idle).

And this way (adding the consoleblank to the GRUB) works even from remote terminals (ssh).

Enjoy! (again)