Display usb power mode on all devices

for i in `find /sys/devices/*/*/usb* -name level` ; do echo -n "$i: " ; cat $i ; done
Sample Output
/sys/devices/pci0000:00/0000:00:1d.0/usb1/power/level: auto
/sys/devices/pci0000:00/0000:00:1d.1/usb2/power/level: auto
/sys/devices/pci0000:00/0000:00:1d.2/usb3/power/level: auto
/sys/devices/pci0000:00/0000:00:1d.2/usb3/3-1/power/level: on
/sys/devices/pci0000:00/0000:00:1d.3/usb5/power/level: auto
/sys/devices/pci0000:00/0000:00:1d.3/usb5/5-1/power/level: auto
/sys/devices/pci0000:00/0000:00:1d.3/usb5/5-2/power/level: auto
/sys/devices/pci0000:00/0000:00:1d.7/usb4/power/level: auto

2
By: path
2009-03-17 16:22:15

These Might Interest You

  • This causes computer to never power off or go into sleep mode. Disables sleep mode linux.


    2
    sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
    symgryph · 2017-04-28 19:49:36 0
  • By using vim, you can also filter content on stdout, using vim's extra power, like search pattern offset! No more awk of course, sorry. details : -e ex mode -s silent -c 'ex command' : global + start and end pattern + offset print (p) -cq : quit Show Sample Output


    0
    vim -e -s -c 'g/start_pattern/+1,/stop_pattern/-1 p' -cq file.txt
    syladmin · 2009-08-26 10:22:27 0
  • `blkid` is an interface to libuuid - it can read Device Mapper, EVMS, LVM, MD, and regular block devices. -c /dev/null - Do not use cached output from /etc/blkid.tab or /etc/blkid/blkid.tab (RHEL) -i - Display I/O Limits (aka I/O topology) information (not available in RHEL) -p - Low-level superblock probing mode (not available in RHEL) Show Sample Output


    2
    blkid -c /dev/null
    mhs · 2012-09-12 13:34:41 2
  • eg: VBoxManage internalcommands createrawvmdk -filename ~/.VBox_sdc.vmdk -rawdisk /dev/sdc In order to start virtual box using block devices, ( Or to boot from it) run as ROOT sudo VirtualBox Then add & select the vmdk file as a device. At last Start the virtual box. - This cmd needs to run once for a device. - See command 8936 to run with out using ROOT power and easy handling of Virtual m/c


    0
    VBoxManage internalcommands createrawvmdk -filename [path/to/file/name.vmdk] -rawdisk /dev/[block_device]
    totti · 2011-08-19 14:26:22 0

What Others Think

This also works using find only: find /sys/devices/*/*/usb* -name level -exec sh -c 'echo -n "{}: "; cat {}' \;
bwoodacre · 479 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: