0

Case-1 Recently I read a question(Brightness is reset to Maximum on every Restart). Then I opened up my terminal and typed out following command-

sudo echo 200 > /sys/class/backlight/intel_backlight/brightness
bash: /sys/class/backlight/intel_backlight/brightness: Permission denied

Since I am using this in root, this command should replace my value. Why value is not being replaced by new one?

Case-2 On folder /sys/class/backlight there is another folder acpi_video0, there is file named brightness, should I need to do something in here?

1 Answers1

2

The normal output redirection operator is always executed with your user privileges, also when you write a sudo in front of the command which generates the STDOUT text. In other words, this will fail if you dont have the permission to write to that file

So sudo echo won't work even when you are using sudo,

you should use tee in this scenario like below

echo 200 | sudo tee /sys/class/backlight/intel_backlight/brightness

astrob0t
  • 1,746