Can't write to file /sys/class/backlight/acpi_video0/brightness (ubuntu)
I am trying to change the brightness by overwriting the value on this file:
sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
-bash: /sys/class/backlight/acpi_video0/brightness: Permission denied
It doesn't work even when using sudo. However if I switch to super-user with su, it works. Why is that?
linux sudo brightness su
migrated from stackoverflow.com Oct 7 '12 at 20:45
This question came from our site for professional and enthusiast programmers.
add a comment |
I am trying to change the brightness by overwriting the value on this file:
sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
-bash: /sys/class/backlight/acpi_video0/brightness: Permission denied
It doesn't work even when using sudo. However if I switch to super-user with su, it works. Why is that?
linux sudo brightness su
migrated from stackoverflow.com Oct 7 '12 at 20:45
This question came from our site for professional and enthusiast programmers.
add a comment |
I am trying to change the brightness by overwriting the value on this file:
sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
-bash: /sys/class/backlight/acpi_video0/brightness: Permission denied
It doesn't work even when using sudo. However if I switch to super-user with su, it works. Why is that?
linux sudo brightness su
I am trying to change the brightness by overwriting the value on this file:
sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
-bash: /sys/class/backlight/acpi_video0/brightness: Permission denied
It doesn't work even when using sudo. However if I switch to super-user with su, it works. Why is that?
linux sudo brightness su
linux sudo brightness su
asked Sep 19 '12 at 23:44
Kei Nivky
migrated from stackoverflow.com Oct 7 '12 at 20:45
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Oct 7 '12 at 20:45
This question came from our site for professional and enthusiast programmers.
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
The error happens because sudo elevates permissions for the command (sudo echo 5) but not the redirection to write the file (> /sys/class/backlight/acpi_video0/brightness). The actual bash shell needs permission to write, which is why it fails with sudo but works as root.
You can work around this by running the tee command as root to write to the file:
echo 5 | sudo tee /sys/class/backlight/acpi_video0/brightness
Note that this will also echo "5" to your terminal. This is a normal side effect of the tee command.
Credit goes to @duskwuff for the cleverteesolution
– mguymon
Sep 20 '12 at 0:45
5
I can't take credit for coming up with that -- it's a bit of UNIX folklore I picked up from who-knows-where.
– duskwuff
Sep 20 '12 at 2:15
not working for me with /sys/class/drm/card0/device/pp_sclk_od cannot change the value
– alexela
Sep 15 '17 at 20:25
add a comment |
If you didn't want 5 to be echoed this also works:
sudo sh -c 'echo 5 > /sys/class/backlight/acpi_video0/brightness'
add a comment |
I've been struggling with this problem on my VAIO VPCEG for quite a time. After doing everything mentioned in every forum I found something interesting:
After changing the boot parameter acpi_osi=Linux acpi_backlight=vendor and trying to manually change /sys/class/backlight/[vendor - in my case intel_backlight]/brightness, I realized that changing permission to this file from root to my user and restarting acpid service, this would allow me to use brightness keys flawlessly.
add a comment |
As written in the Arch wiki (link), by default, only root can change the brightness by this method. To allow users in the video group to change the brightness, a udev rule such as the following can be used:
% cat /etc/udev/rules.d/backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
Then you need to add your user to the video group. After that this should work:
echo 5 > /sys/class/backlight/acpi_video0/brightness
add a comment |
the below solutions works fine for me..
i am posting it as answer so that others might get help:
change the permission:
sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness
now change brightness:
echo 400 > /sys/class/backlight/intel_backlight/brightness
in your case it would be: /sys/class/backlight/acpi_video0/brightness
Welcome to Super User! Please don't add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Super User way of saying thank you.
– DavidPostill♦
Jun 29 '15 at 13:51
In addition you didn't really answer the question, which was "Why is that?"
– DavidPostill♦
Jun 29 '15 at 13:52
thanks a lot.. for the information and really sorry.. just because of me.. you wasted your important time for guiding me..i will make sure this doesn't happen again
– noobdeveloper99
Jun 29 '15 at 15:49
It is not good practice to allow everyone to read and write a system config file like that.
– lindhe
Dec 18 '15 at 15:15
I have some scenarios, where the screen starts functioning, yet the backlight value is still 0,
– ransh
Nov 26 '16 at 21:22
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f484678%2fcant-write-to-file-sys-class-backlight-acpi-video0-brightness-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
The error happens because sudo elevates permissions for the command (sudo echo 5) but not the redirection to write the file (> /sys/class/backlight/acpi_video0/brightness). The actual bash shell needs permission to write, which is why it fails with sudo but works as root.
You can work around this by running the tee command as root to write to the file:
echo 5 | sudo tee /sys/class/backlight/acpi_video0/brightness
Note that this will also echo "5" to your terminal. This is a normal side effect of the tee command.
Credit goes to @duskwuff for the cleverteesolution
– mguymon
Sep 20 '12 at 0:45
5
I can't take credit for coming up with that -- it's a bit of UNIX folklore I picked up from who-knows-where.
– duskwuff
Sep 20 '12 at 2:15
not working for me with /sys/class/drm/card0/device/pp_sclk_od cannot change the value
– alexela
Sep 15 '17 at 20:25
add a comment |
The error happens because sudo elevates permissions for the command (sudo echo 5) but not the redirection to write the file (> /sys/class/backlight/acpi_video0/brightness). The actual bash shell needs permission to write, which is why it fails with sudo but works as root.
You can work around this by running the tee command as root to write to the file:
echo 5 | sudo tee /sys/class/backlight/acpi_video0/brightness
Note that this will also echo "5" to your terminal. This is a normal side effect of the tee command.
Credit goes to @duskwuff for the cleverteesolution
– mguymon
Sep 20 '12 at 0:45
5
I can't take credit for coming up with that -- it's a bit of UNIX folklore I picked up from who-knows-where.
– duskwuff
Sep 20 '12 at 2:15
not working for me with /sys/class/drm/card0/device/pp_sclk_od cannot change the value
– alexela
Sep 15 '17 at 20:25
add a comment |
The error happens because sudo elevates permissions for the command (sudo echo 5) but not the redirection to write the file (> /sys/class/backlight/acpi_video0/brightness). The actual bash shell needs permission to write, which is why it fails with sudo but works as root.
You can work around this by running the tee command as root to write to the file:
echo 5 | sudo tee /sys/class/backlight/acpi_video0/brightness
Note that this will also echo "5" to your terminal. This is a normal side effect of the tee command.
The error happens because sudo elevates permissions for the command (sudo echo 5) but not the redirection to write the file (> /sys/class/backlight/acpi_video0/brightness). The actual bash shell needs permission to write, which is why it fails with sudo but works as root.
You can work around this by running the tee command as root to write to the file:
echo 5 | sudo tee /sys/class/backlight/acpi_video0/brightness
Note that this will also echo "5" to your terminal. This is a normal side effect of the tee command.
answered Sep 19 '12 at 23:54
mguymonmguymon
24625
24625
Credit goes to @duskwuff for the cleverteesolution
– mguymon
Sep 20 '12 at 0:45
5
I can't take credit for coming up with that -- it's a bit of UNIX folklore I picked up from who-knows-where.
– duskwuff
Sep 20 '12 at 2:15
not working for me with /sys/class/drm/card0/device/pp_sclk_od cannot change the value
– alexela
Sep 15 '17 at 20:25
add a comment |
Credit goes to @duskwuff for the cleverteesolution
– mguymon
Sep 20 '12 at 0:45
5
I can't take credit for coming up with that -- it's a bit of UNIX folklore I picked up from who-knows-where.
– duskwuff
Sep 20 '12 at 2:15
not working for me with /sys/class/drm/card0/device/pp_sclk_od cannot change the value
– alexela
Sep 15 '17 at 20:25
Credit goes to @duskwuff for the clever
tee solution– mguymon
Sep 20 '12 at 0:45
Credit goes to @duskwuff for the clever
tee solution– mguymon
Sep 20 '12 at 0:45
5
5
I can't take credit for coming up with that -- it's a bit of UNIX folklore I picked up from who-knows-where.
– duskwuff
Sep 20 '12 at 2:15
I can't take credit for coming up with that -- it's a bit of UNIX folklore I picked up from who-knows-where.
– duskwuff
Sep 20 '12 at 2:15
not working for me with /sys/class/drm/card0/device/pp_sclk_od cannot change the value
– alexela
Sep 15 '17 at 20:25
not working for me with /sys/class/drm/card0/device/pp_sclk_od cannot change the value
– alexela
Sep 15 '17 at 20:25
add a comment |
If you didn't want 5 to be echoed this also works:
sudo sh -c 'echo 5 > /sys/class/backlight/acpi_video0/brightness'
add a comment |
If you didn't want 5 to be echoed this also works:
sudo sh -c 'echo 5 > /sys/class/backlight/acpi_video0/brightness'
add a comment |
If you didn't want 5 to be echoed this also works:
sudo sh -c 'echo 5 > /sys/class/backlight/acpi_video0/brightness'
If you didn't want 5 to be echoed this also works:
sudo sh -c 'echo 5 > /sys/class/backlight/acpi_video0/brightness'
answered May 23 '15 at 17:42
raphaelraphael
211
211
add a comment |
add a comment |
I've been struggling with this problem on my VAIO VPCEG for quite a time. After doing everything mentioned in every forum I found something interesting:
After changing the boot parameter acpi_osi=Linux acpi_backlight=vendor and trying to manually change /sys/class/backlight/[vendor - in my case intel_backlight]/brightness, I realized that changing permission to this file from root to my user and restarting acpid service, this would allow me to use brightness keys flawlessly.
add a comment |
I've been struggling with this problem on my VAIO VPCEG for quite a time. After doing everything mentioned in every forum I found something interesting:
After changing the boot parameter acpi_osi=Linux acpi_backlight=vendor and trying to manually change /sys/class/backlight/[vendor - in my case intel_backlight]/brightness, I realized that changing permission to this file from root to my user and restarting acpid service, this would allow me to use brightness keys flawlessly.
add a comment |
I've been struggling with this problem on my VAIO VPCEG for quite a time. After doing everything mentioned in every forum I found something interesting:
After changing the boot parameter acpi_osi=Linux acpi_backlight=vendor and trying to manually change /sys/class/backlight/[vendor - in my case intel_backlight]/brightness, I realized that changing permission to this file from root to my user and restarting acpid service, this would allow me to use brightness keys flawlessly.
I've been struggling with this problem on my VAIO VPCEG for quite a time. After doing everything mentioned in every forum I found something interesting:
After changing the boot parameter acpi_osi=Linux acpi_backlight=vendor and trying to manually change /sys/class/backlight/[vendor - in my case intel_backlight]/brightness, I realized that changing permission to this file from root to my user and restarting acpid service, this would allow me to use brightness keys flawlessly.
edited Nov 13 '13 at 22:10
Moses
9,1142158106
9,1142158106
answered Nov 13 '13 at 21:48
user273880user273880
1
1
add a comment |
add a comment |
As written in the Arch wiki (link), by default, only root can change the brightness by this method. To allow users in the video group to change the brightness, a udev rule such as the following can be used:
% cat /etc/udev/rules.d/backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
Then you need to add your user to the video group. After that this should work:
echo 5 > /sys/class/backlight/acpi_video0/brightness
add a comment |
As written in the Arch wiki (link), by default, only root can change the brightness by this method. To allow users in the video group to change the brightness, a udev rule such as the following can be used:
% cat /etc/udev/rules.d/backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
Then you need to add your user to the video group. After that this should work:
echo 5 > /sys/class/backlight/acpi_video0/brightness
add a comment |
As written in the Arch wiki (link), by default, only root can change the brightness by this method. To allow users in the video group to change the brightness, a udev rule such as the following can be used:
% cat /etc/udev/rules.d/backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
Then you need to add your user to the video group. After that this should work:
echo 5 > /sys/class/backlight/acpi_video0/brightness
As written in the Arch wiki (link), by default, only root can change the brightness by this method. To allow users in the video group to change the brightness, a udev rule such as the following can be used:
% cat /etc/udev/rules.d/backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
Then you need to add your user to the video group. After that this should work:
echo 5 > /sys/class/backlight/acpi_video0/brightness
edited Jan 12 at 12:09
answered Jan 12 at 11:59
Manuel SchmitzbergerManuel Schmitzberger
1012
1012
add a comment |
add a comment |
the below solutions works fine for me..
i am posting it as answer so that others might get help:
change the permission:
sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness
now change brightness:
echo 400 > /sys/class/backlight/intel_backlight/brightness
in your case it would be: /sys/class/backlight/acpi_video0/brightness
Welcome to Super User! Please don't add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Super User way of saying thank you.
– DavidPostill♦
Jun 29 '15 at 13:51
In addition you didn't really answer the question, which was "Why is that?"
– DavidPostill♦
Jun 29 '15 at 13:52
thanks a lot.. for the information and really sorry.. just because of me.. you wasted your important time for guiding me..i will make sure this doesn't happen again
– noobdeveloper99
Jun 29 '15 at 15:49
It is not good practice to allow everyone to read and write a system config file like that.
– lindhe
Dec 18 '15 at 15:15
I have some scenarios, where the screen starts functioning, yet the backlight value is still 0,
– ransh
Nov 26 '16 at 21:22
add a comment |
the below solutions works fine for me..
i am posting it as answer so that others might get help:
change the permission:
sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness
now change brightness:
echo 400 > /sys/class/backlight/intel_backlight/brightness
in your case it would be: /sys/class/backlight/acpi_video0/brightness
Welcome to Super User! Please don't add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Super User way of saying thank you.
– DavidPostill♦
Jun 29 '15 at 13:51
In addition you didn't really answer the question, which was "Why is that?"
– DavidPostill♦
Jun 29 '15 at 13:52
thanks a lot.. for the information and really sorry.. just because of me.. you wasted your important time for guiding me..i will make sure this doesn't happen again
– noobdeveloper99
Jun 29 '15 at 15:49
It is not good practice to allow everyone to read and write a system config file like that.
– lindhe
Dec 18 '15 at 15:15
I have some scenarios, where the screen starts functioning, yet the backlight value is still 0,
– ransh
Nov 26 '16 at 21:22
add a comment |
the below solutions works fine for me..
i am posting it as answer so that others might get help:
change the permission:
sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness
now change brightness:
echo 400 > /sys/class/backlight/intel_backlight/brightness
in your case it would be: /sys/class/backlight/acpi_video0/brightness
the below solutions works fine for me..
i am posting it as answer so that others might get help:
change the permission:
sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness
now change brightness:
echo 400 > /sys/class/backlight/intel_backlight/brightness
in your case it would be: /sys/class/backlight/acpi_video0/brightness
answered Jun 29 '15 at 13:19
noobdeveloper99noobdeveloper99
111
111
Welcome to Super User! Please don't add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Super User way of saying thank you.
– DavidPostill♦
Jun 29 '15 at 13:51
In addition you didn't really answer the question, which was "Why is that?"
– DavidPostill♦
Jun 29 '15 at 13:52
thanks a lot.. for the information and really sorry.. just because of me.. you wasted your important time for guiding me..i will make sure this doesn't happen again
– noobdeveloper99
Jun 29 '15 at 15:49
It is not good practice to allow everyone to read and write a system config file like that.
– lindhe
Dec 18 '15 at 15:15
I have some scenarios, where the screen starts functioning, yet the backlight value is still 0,
– ransh
Nov 26 '16 at 21:22
add a comment |
Welcome to Super User! Please don't add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Super User way of saying thank you.
– DavidPostill♦
Jun 29 '15 at 13:51
In addition you didn't really answer the question, which was "Why is that?"
– DavidPostill♦
Jun 29 '15 at 13:52
thanks a lot.. for the information and really sorry.. just because of me.. you wasted your important time for guiding me..i will make sure this doesn't happen again
– noobdeveloper99
Jun 29 '15 at 15:49
It is not good practice to allow everyone to read and write a system config file like that.
– lindhe
Dec 18 '15 at 15:15
I have some scenarios, where the screen starts functioning, yet the backlight value is still 0,
– ransh
Nov 26 '16 at 21:22
Welcome to Super User! Please don't add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Super User way of saying thank you.
– DavidPostill♦
Jun 29 '15 at 13:51
Welcome to Super User! Please don't add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the Super User way of saying thank you.
– DavidPostill♦
Jun 29 '15 at 13:51
In addition you didn't really answer the question, which was "Why is that?"
– DavidPostill♦
Jun 29 '15 at 13:52
In addition you didn't really answer the question, which was "Why is that?"
– DavidPostill♦
Jun 29 '15 at 13:52
thanks a lot.. for the information and really sorry.. just because of me.. you wasted your important time for guiding me..i will make sure this doesn't happen again
– noobdeveloper99
Jun 29 '15 at 15:49
thanks a lot.. for the information and really sorry.. just because of me.. you wasted your important time for guiding me..i will make sure this doesn't happen again
– noobdeveloper99
Jun 29 '15 at 15:49
It is not good practice to allow everyone to read and write a system config file like that.
– lindhe
Dec 18 '15 at 15:15
It is not good practice to allow everyone to read and write a system config file like that.
– lindhe
Dec 18 '15 at 15:15
I have some scenarios, where the screen starts functioning, yet the backlight value is still 0,
– ransh
Nov 26 '16 at 21:22
I have some scenarios, where the screen starts functioning, yet the backlight value is still 0,
– ransh
Nov 26 '16 at 21:22
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f484678%2fcant-write-to-file-sys-class-backlight-acpi-video0-brightness-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown