Turn off monitor from Linux CLI

Noah Petherbridge
kirsle
Posted by Noah Petherbridge on Wednesday, March 21 2012 @ 10:31:37 AM
I keep looking up this information and then losing track of it, so I'm posting it here for my own reference.

This command will turn off the monitor on a Linux box from the command line (sorta like what happens when you have your power saving options configured to do this automatically after a length of time):

xset dpms force off
The monitor turns off until you hit a keyboard button or move the mouse. With this info you could set up a keyboard shortcut to run this command and have something like a "lock screen button" on your netbook, to turn off the display on command and conserve battery life for a little bit longer than usual.

For a "lock screen button" that also locks the screen in addition to turning it off, a pair of commands like this may be handy:

xset dpms force off; xscreensaver-command --lock

Categories:

[ Blog ]

Comments

There are 13 comments on this page.

guest
guest
Posted on Thursday, July 26 2012 @ 08:43:20 PM by blueskull.

Thank you!

guest
guest
Posted on Tuesday, March 26 2013 @ 08:39:27 AM by mertin.

I always forget how to do this and your page is the first one that comes up in the google search. Thanks for the simple handy tip

guest
guest
Posted on Thursday, March 28 2013 @ 08:01:02 PM by me.

thanks!!

guest
guest
Posted on Tuesday, May 28 2013 @ 05:57:43 AM by Coder@linux.

Hi I am trying to turn off 4 monitors at a time using the above command. It so happens that it turns off the 3 monitors except for 1 which displays RGB screensaver . Can you suggest a way out to turn off all the 4 monitors .

guest
guest
Posted on Tuesday, July 30 2013 @ 02:40:35 PM by easoncxz.

Simple works. Thanks for sharing!

guest
guest
Posted on Wednesday, October 02 2013 @ 08:18:24 AM by Anonymous.

thanks!

guest
guest
Posted on Sunday, March 09 2014 @ 12:35:21 PM by A.Nony.Mouse.

Thanks, needed a way to do this from an "at" job in the middle of the night.

Avatar
guest
Posted on Monday, October 27 2014 @ 11:33:53 PM by Javier Acosta.

thank you very much!

Avatar
guest
Posted on Thursday, January 29 2015 @ 08:31:15 AM by Pooping.

in the Shower
tf2
get good get lmaobox
poop.

Avatar
guest
Posted on Monday, June 08 2015 @ 04:11:06 AM by Bocskai Csaba.

Thanks a lot!
I wonder if it's simple to create a button for this...

guest
guest
Posted on Tuesday, June 09 2015 @ 10:56:37 PM by Habib.

Thanks! This was a big help...

guest
guest
Posted on Tuesday, August 25 2015 @ 09:19:04 AM by Subin.

Thanks a ton !! Very Helpful.
You could write a shell script as follows and run it from the Desktop like a batch file in windows

Create a new file with text editor

#!/bin/bash
xset dpms force off

Save file as .sh extension
Chmod 755 <file name> to set permissions

guest
guest
Posted on Thursday, August 18 2016 @ 01:53:23 PM by 7Blink.

Thank you. I created a Desktop Icon with that command to put my monitor to sleep.

Add a Comment

Your name:
Your Email:
Message:
Comments can be formatted with Markdown, and you can use
emoticons in your comment.

If you can see this, don't touch the following fields.