0

This question already has an answer here:

I tried lsusb and I can see my mouse in the list.

I tried

for foo in /sys/bus/usb/devices/*/power/level;
> do echo on > $foo;
> done

But I got this reply

bash: /sys/bus/usb/devices/1-4/power/level: Permission denied
bash: /sys/bus/usb/devices/2-2/power/level: Permission denied
bash: /sys/bus/usb/devices/5-1/power/level: Permission denied
bash: /sys/bus/usb/devices/5-3/power/level: Permission denied
bash: /sys/bus/usb/devices/usb1/power/level: Permission denied
bash: /sys/bus/usb/devices/usb2/power/level: Permission denied
bash: /sys/bus/usb/devices/usb3/power/level: Permission denied
bash: /sys/bus/usb/devices/usb4/power/level: Permission denied
bash: /sys/bus/usb/devices/usb5/power/level: Permission denied
bash: /sys/bus/usb/devices/usb6/power/level: Permission denied

Note that this only happens whenever my laptop is unplugged.

marked as duplicate by bain, Eric Carvalho, Panther, nux, Warren Hill Jul 16 '14 at 9:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • - you probably need to do that as root (so after doing sudo su). – Rinzwind Apr 6 '14 at 5:17
0

Your code should be,

for i in /sys/bus/usb/devices/*/power/level; do sudo echo on > $i; done

OR

for i in /sys/bus/usb/devices/*/power/level; do sudo sh -c "echo on > $i"; done
  • The first doesn't work, it would only do the echo with sudo – rubo77 Oct 10 '14 at 10:45

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