Change the Display Brightness via Command Line

In this article I will show you how set the display brightness by the command line interface (terminal or konsole).

Your current brightness value is stored in the /sys/class/backlight/acpi_video0/brightness file.

So, you can echo a value, between 0 and 10 to the /sys/class/backlight/acpi_video0/brightness file.

# echo 3 > /sys/class/backlight/acpi_video0/brightness

# echo 5 > /sys/class/backlight/acpi_video0/brightness

# echo 7 > /sys/class/backlight/acpi_video0/brightness

To set the maximul brightness value, use this trick:

# cat /sys/class/backlight/acpi_video0/max_brightness > /sys/class/backlight/acpi_video0/brightness

To set the minimum brightness, use the 0 (zero) value:

# echo 0 > /sys/class/backlight/acpi_video0/brightness

I have created this two aliases that manipulate my display brightness:

For setting the minimum brightness:

$ alias minbr='echo 0 > /sys/class/backlight/acpi_video0/brightness'

For setting the maximum brightness:

$ alias maxbr='cat /sys/class/backlight/acpi_video0/max_brightness > /sys/class/backlight/acpi_video0/brightness'

If you like my aliases and want to make them persistent, add the two code lines to you ~/.bashrc file.

I just type in the terminal minbr or maxbr, depending on my needs.

Tagged with: , , , , , , ,
Posted in The Linux and Unix Articles!
3 comments on “Change the Display Brightness via Command Line
  1. frank kamara says:

    i appriciate this thanks for all who put their works in this tips

  2. vig says:

    Hi! First of all thanks for the post.

    I have a question, in the line

    alias minbr=’echo 0 > /sys/class/backlight/acpi_video0/brightness’

    what does exactly ‘‘minbr’’ means? Is it for allowing me to change the file with ordinary permissions?


    • Geekster says:

      no,it is just a short name for the command. instead of doing echo 0 > /sys/class/backlight/acpi_video0/brightness every time, you just open a terminal and type minbr. it does not change any file permissions.

Leave a Reply

Your email address will not be published. Required fields are marked *




Subscribe to get the latest Linux news and how to guides directly on your e-mail!