Skip to content

Instantly share code, notes, and snippets.

@yumpy
Last active October 27, 2022 12:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yumpy/f0747129740e062dc929e38b8e329cb4 to your computer and use it in GitHub Desktop.
Save yumpy/f0747129740e062dc929e38b8e329cb4 to your computer and use it in GitHub Desktop.
To reset USB Hub
# from: https://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line
#
# This will reset all of USB1/2/3 attached ports[1]:
#
for i in /sys/bus/pci/drivers/[uoex]hci_hcd/*:*; do
echo "${i##*/}" > "${i%/*}/unbind"
echo "${i##*/}" > "${i%/*}/bind"
done
@deajan
Copy link

deajan commented Oct 27, 2022

Hello,
This saved me a lot of headaches.
Built a script around it at https://github.com/netinvent/usb_resetter
Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment