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

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

| improve this answer | |
  • Thank You very much, not only you gave me solution of my problem but also told me logic behind all these, now I understood. – avirajkhare00 Nov 6 '14 at 17:43
  • 1
    @aVIRA or you can use sudo su -c "echo 200 >/sys/class/backlight/intel_backlight/brightness" – αғsнιη Nov 6 '14 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.