commands.page Website Logo

  • Home
  • Categories
  • Search

How to List All Connected USB Devices on the Terminal in Ubuntu

This is an article about how to list all connected USB devices on your system terminal using various commands and tools specifically designed for Ubuntu Linux. In this article, you will find information about different methods that can help users easily identify which USB devices are currently connected to their computer.

Introduction

Ubuntu, a popular Linux distribution, provides a command-line interface through its Terminal application. This tool allows advanced users to interact with the system’s hardware and software in ways graphical user interfaces cannot always match. One of these interactions is identifying all connected USB devices. This article explores several methods you can use from within the terminal to list your attached USB devices.

Why List Connected USB Devices?

Listing the connected USB devices helps monitor which external storage devices or other peripherals are currently plugged into your computer. It’s also useful for troubleshooting issues related to hardware detection or connectivity problems with specific USB devices.

Prerequisites

Before proceeding, ensure that you have access to an Ubuntu system and its terminal interface. You should be comfortable using basic Linux commands such as ls, cd, and navigating directories within the Terminal application.

Method 1: Using lsusb Command

The simplest method to list USB devices connected to your computer is by using the lsusb command. This utility lists all USB buses in the system and their devices, providing detailed information about each one.

Step-by-Step Instructions:

  1. Open Terminal: You can open it through Application Menu > Accessories or via Ctrl+Alt+T shortcut.
  2. Enter Command:
    lsusb
  3. Review Output: The command will output a list of all USB devices connected to your system, each with its vendor ID and product ID.

Example Output:

Bus 001 Device 004: ID 25d7:b3c8 (Vendor) Type-A Adapter Bus 001 Device 003: ID 16a9:0b61 Verbatim Technology Store 'N' Go USB Drive Bus 001 Device 002: ID 8087:0aaa Intel Corp. Integrated Rate Matching Hub

Each line provides the bus number, device number, vendor ID and product ID along with a brief description if it’s recognized.

Method 2: Using lsblk Command

While primarily used to list block devices such as hard drives and partitions, lsblk can also help you find connected USB storage devices by filtering out non-USB devices from the list. This method is particularly useful when looking for external HDDs or flash drives.

Step-by-Step Instructions:

  1. Open Terminal
  2. Enter Command:
    lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE | grep -i usb
  3. Review Output: The command outputs information related to USB storage devices mounted on your system.

Example Output:

sdc vfat DATA /media/user/1234-5678 999M

This output shows the device name (e.g., sdc), file system type (vfat), label (if any), mount point, and size for USB storage devices.

Method 3: Using /sys Filesystem

The /sys filesystem is another way to access information about hardware connected to your Linux machine. This method involves navigating through specific directories in the sysfs hierarchy to locate details about USB devices.

Step-by-Step Instructions:

  1. Open Terminal
  2. Enter Command:
    cat /sys/bus/usb/devices/*/product
  3. Review Output: The command will list all product names of connected USB devices directly under the /sys directory structure.

Method 4: Using dmesg and grep

The dmesg utility is used to print out kernel messages, including those generated when a device such as a USB drive is plugged in. By combining this with the grep command, you can filter these messages to show only those related to USB devices.

Step-by-Step Instructions:

  1. Open Terminal
  2. Enter Command:
    dmesg | grep usb
  3. Review Output: The output will include kernel messages about USB devices being detected or any issues encountered during detection.

Method 5: Using inxi Tool

For a more comprehensive and user-friendly display of system hardware, including connected USB devices, you can use the inxi tool. This utility provides detailed information in human-readable format without requiring complex commands.

Step-by-Step Instructions:

  1. Install Inxi (if not already installed):
    sudo apt-get install inxi
  2. Open Terminal
  3. Enter Command:
    inxi -Fxz | grep USB

Example Output:

USB: 4x USB v1.x, 1x USB v2.x, 0 USB Host Controller, 9 USB Device(s): ...

This example shows a summary of the USB hardware available and lists all devices connected via these interfaces.

Conclusion

In this article, you’ve learned about multiple ways to list all connected USB devices on an Ubuntu system using its terminal interface. These methods range from simple commands like lsusb to more advanced techniques such as parsing /sys filesystem data or utilizing tools like inxi. Each method has its advantages and can be chosen based on the specific requirements of your task, whether it’s quick identification or detailed diagnostics.

By mastering these techniques, you’ll enhance your ability to manage hardware resources effectively in a Linux environment.

Last Modified: 22/03/2018 - 00:29:27