DEV Community

Jacopo Valanzano
Jacopo Valanzano

Posted on • Updated on


🐧 Linux - Nifty Shell Commands #1

Disconnect and reconnect a USB device, with Linux kernel:

On my device, i have 4 USB ports, and they are all listed in
as 1-1 1-1.3 1-1.4 and 2-1 respectively.

$ ls /sys/bus/usb/drivers/usb

Inspect dmesg to analyse each USB device
$ dmesg

Let's say the USB 1-1.3 needs to be reconnected:

$ echo 1-1.3 > /sys/bus/usb/drivers/usb/unbind

Wait, give some time to both the device and the kernel

$ sleep 5

Reconnect the USB drive

$ echo 1-1.3 > /sys/bus/usb/drivers/usb/bind

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git