ubuntu : turn off screen

Let us talk about scripts, HTML, Perl, PHP, apache, etc.
User avatar
Stevyn
SysOp
Posts:1776
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:
ubuntu : turn off screen

Post by Stevyn » Mon Jan 27, 2020 11:24 am

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)
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

Post Reply