Login
You're viewing the techdon.dev public feed.
  • Jul 1, 2026, 4:24 AM

    #HackOfTheDay 'cyme' (cargo install cyme, it's a rust program) is a smarter colour-enabled descendent of 'lsusb' which lists the usb devices on your computer. On linux I habitually run 'sudo dmesg -w' when working with USB devices to see the system log of device connects and disconnects. On Mac it's a pain to get the same. So I wrote this oneliner that shows the most recently attached or removed USB device.

    ```
    rm usb-was ; touch usb-was ; while : ; do now=`date`; cyme -t | sed -e '/T2Bus /,$d' >usb-now ; diff usb-was usb-now >/dev/null ; if [ $? -ne 0 ] ; then clear ; cat usb-now ; echo "$now CHANGE:" ; diff usb-was usb-now ; cp usb-now usb-was ; else echo -n "$now \r" ; fi ; sleep 1 ; done
    ```

    Screenshot of the output of a script that produces a coloured listing of USB devices, and then shows the time and specifics of the most recent change to the USB bus.   The apple internal USB bus is filtered out.    It'll probably work on Linux too.
    💬 0🔄 4⭐ 6