Linux show usb devices

Linux: How do I list all USB devices?

Q. How do I list all USB devices connected to my computer / Linux laptop?

A. You need to use command called lsusb. It is a utility for displaying information about USB buses in the system and the devices connected to them under Linux kernel.

lsusb – list USB devices

To make use of all the features of this program, you need to have a Linux kernel which supports the /proc/bus/usb interface (e.g., Linux kernel 2.3.15 or newer).
$ lsusb
Output:

To get verbose output type the command:
$ lsusb -v

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

See also:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

Hi im new into reading unsupported usb devices on linux and I have a question to ask, after that whats the next step to do? how can I read the raw data (if thats the right way to call it like that), and what type of applications can I use to getting the data… Any help I will apreciate it. BTW Im trying to getting the pictures of a Disney Jonas Brother Digital Still Camera or use it like a webcam or something else like controlling when to take pictures, you know the usual stuff.

Hi there, how would I go about determining the port number of a specific USB device?

with an older zonet bluetooth dongle not showing in lsusb or errors in dmesg how can I tell if there are any interactions when plugged? (Mint 15 64bit mate)

If the device has been formatted and given a path on the system, then typing “df” will show the device/path on the list. If you unplug it and type “df” again, then compare the two lists, you can see which one it is.

Источник

4 Useful Way to Know Plugged USB Device Name in Linux

As a newbie, one of the many things you should master in Linux is identification of devices attached to your system. It may be your computer’s hard disk, an external hard drive or removable media such USB drive or SD Memory card.

Using USB drives for file transfer is so common today, and for those (new Linux users) who prefer to use the command line, learning the different ways to identify a USB device name is very important, when you need to format it.

Once you attach a device to your system such as a USB, especially on a desktop, it is automatically mounted to a given directory, normally under /media/username/device-label and you can then access the files in it from that directory. However, this is not the case with a server where you have to manually mount a device and specify its mount point.

Linux identifies devices using special device files stored in /dev directory. Some of the files you will find in this directory include /dev/sda or /dev/hda which represents your first master drive, each partition will be represented by a number such as /dev/sda1 or /dev/hda1 for the first partition and so on.

List All Linux Device Names

Now let’s find out device names using some different command-line tools as shown:

Find Out Plugged USB Device Name Using df Command

To view each device attached to your system as well as its mount point, you can use the df command (checks Linux disk space utilization) as shown in the image below:

Find USB Device Name Using df Command

Use lsblk Command to Find USB Device Name

You can also use the lsblk command (list block devices) which lists all block devices attached to your system like so:

List Linux Block Devices

Identify USB Device Name with fdisk Utility

fdisk is a powerful utility which prints out the partition table on all your block devices, a USB drive inclusive, you can run it will root privileges as follows:

List Partition Table of Block Devices

Determine USB Device Name with dmesg Command

dmesg is an important command that prints or controls the kernel ring buffer, a data structure which stores information about the kernel’s operations.

Run the command below to view kernel operation messages which will as well print information about your USB device:

dmesg – Prints USB Device Name

That is all for now, in this article, we have covered different approaches of how to find out a USB device name from the command line. You can also share with us any other methods for the same purpose or perhaps offer us your thoughts about the article via the response section below.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

Как в Linux посмотреть подключенные USB устройства

В настоящее время многие компьютерные периферийные устройства, такие как веб-камеры, мыши, сканеры, принтеры, жесткие диски, USB (Pendrive) подключаются по USB. После того, как эти устройства подключены к рабочему столу или серверу, важно знать имя устройства или путь к нему. Это помогает идентифицировать USB устройства для таких задач, как форматирование или отключение.

В Linux все файлы устройств хранятся в каталоге /dev и должны быть доступны во время загрузки системы.

В этой статье я покажу вам различные способы как в ubuntu посмотреть usb устройства. Большинство команд, упомянутых здесь, должны работать практически на всех дистрибутивах Linux. Например Ubuntu, Debian, Mint.

Просмотр списка имен USB устройств с помощью команды df

Команда df — это полезная команда, которая может помочь составить список всех подключенных томов, включая USB-накопители.

Как только USB-устройство подключается в систему Linux, это устройство автоматически монтируется в раздел /media и становится готовым к использованию.

Из приведенного выше вывода следует, что у меня есть 1 USB-накопитель /dev/sdb с 2 разделами /dev/sdb1 и /dev/sdb2

Список имен подключенных USB — устройств с помощью команды lsblk

Команда Lsblk используется для перечисления всех блочных устройств в системе Linux. Из списка можно фильтровать USB-устройства с помощью команды grep.

Чтобы получить дополнительную информацию, такую как UUID, производитель и тип файловой системы, используйте команду blkid, как показано на рисунке ниже.

Список USB — устройств с помощью команды fdisk

Вы можете использовать старую добрую команду fdisk, которая используется для разбиения томов на разделы, чтобы перечислить все разделы в системе Linux, включая USB-накопители.

Запятая будет отображать подробную информацию о вашем USB-томе, включая разделы , размер тома, секторы и тип файловой системы.

Список сведений о подключенных USB-устройствах с помощью команды lsusb

Команда lsusb, также известная как команда “List USB”, используется в Linux для перечисления всех USB-устройств, подключенных к системе.

На выводе выше отображается идентификатор шины, идентификатор устройства, идентификатор USB, а также поставщик или производитель USB-устройств

Команда lsusb перечисляет подключенные устройства и не предоставляет дополнительной информации о USB-устройствах.

Для получения дополнительной информации о подключенных USB устройствах используйте команду dmesg. Команда dmesg, также известная как “сообщение драйвера” или “показать сообщение”, используется для проверки загрузочных сообщений. Кроме того, эта команда используется для отладки проблем, связанных с оборудованием и печати сообщений, генерируемых драйверами устройств.

Вы можете использовать команду dmesg и grep, чтобы сузиться до USB-устройств.

Кроме того, вы можете передать вывод команды dmesg в less для облегчения прокрутки.

На выходе вы можете найти определенную строку, нажав клавишу прямой косой черты ( / ) на клавиатуре, а затем имя или идентификатор устройства USB-устройства.

В моем случае я ищу дополнительную информацию о USB устройстве под названием SanDisk.

Поиск USB-накопителя

Список USB контроллеров и устройств, использующих USB устройства

Команда usb-devices-это сценарий оболочки, который позволяет вам перечислить все USB-контроллеры и USB-устройства, подключенные к вашему компьютеру. Он печатает детали USB-устройства, такие как производитель, название продукта, серийный номер и многое другое. Вот вывод команды:

Заключение

В этой статье мы продемонстрировали различные способы просмотра USB-устройств, подключенных к системе Linux.

Источник

How to Use Linux to Find the Names of the Devices on Your Computer

Try these commands to show devices on your computer

Listing the devices, drives, PCI devices, and USB devices on your computer involves a series of commands easily invoked from a shell prompt in Linux.

Use the ‘mount’ Command

The most simple syntax you can use is as follows:

The output from the above command is fairly verbose and will be something like this:

Hard drives generally start with /dev/sda or /dev/sdb, so use the grep command to reduce the output as follows:

The results show something like this:

This doesn’t list your drives but it does list your mounted partitions. It doesn’t list partitions that aren’t yet mounted.

The device /dev/sda usually stands for the first hard drive on your system, and if you have a second hard drive, then it will be mounted to /dev/sdb. If you have an SSD, then this will likely be mapped to /dev/sda and the hard drive mapped to /dev/sdb.

Use ‘lsblk’ to List Block Devices

Mount is fine for listing mounted devices, but it doesn’t show every device you have, and the output is verbose, making it difficult to read.

The best way to list the drives in Linux is to use lsblk as follows:

The information displays in a tree format with the following information:

  • Name
  • Major Minor device number
  • Is it removable
  • Size
  • Is it read-only
  • Is it a disk or a partition
  • Where is the partition mounted

The display looks something like this:

The information is easier to read. It displays one drive called sda, which offers 50 G of storage. It splits into one partition, called sda1.

The drives fd0 (floppy) and sr0 (CD-ROM) appear in this listing. The particular machine this listing drew from, called mint-vm, is a Linux Mint virtual machine running in the Hyper-V system on a Windows 10 computer. Hyper-V provisions a virtual floppy and CD-ROM drive by default.

How to List PCI Devices

To list the PCI devices use the lspci command as follows:

The output from the above command is verbose, meaning you probably get more information than you need.

Here’s a short snapshot as an example:

The listing lists devices, including VGA controllers, USB controllers, sound, Bluetooth, wireless, and Ethernet controllers.

The standard lspci listing is considered basic, and if you want more detailed information about each device, run the following command:

The information for each device looks something like this:

The output from the lspci -v command is more readable.

You can get even more verbose output by using the following command:

If that isn’t enough information, try the following:

The most useful aspect of lspci, other than listing devices, is the kernel driver used for that device. If the device isn’t working, it is worth researching whether there is a better driver available for the device.

List the USB Devices Attached to the Computer

To list the USB devices available for your computer, use the following command:

The output will be something like this:

If you insert a USB device into the computer, such as an external hard drive, and then run the lsusb command, the device appears on the list.

Summary

The best way to list anything in Linux is to remember the following ls commands:

Источник

Читайте также:  Инициализация диска mac os
Оцените статью