- 4 Useful Way to Know Plugged USB Device Name in Linux
- Find Out Plugged USB Device Name Using df Command
- Use lsblk Command to Find USB Device Name
- Identify USB Device Name with fdisk Utility
- Determine USB Device Name with dmesg Command
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- Как в Linux посмотреть подключенные USB устройства
- Просмотр списка имен USB устройств с помощью команды df
- Список имен подключенных USB — устройств с помощью команды lsblk
- Список USB — устройств с помощью команды fdisk
- Список сведений о подключенных USB-устройствах с помощью команды lsusb
- Список USB контроллеров и устройств, использующих USB устройства
- Заключение
- Find USB device details in Linux/Unix using lsusb command
- What is USB?
- Learn lsusb command with examples
- List USB Devices Linux
- Listing USB Devices using lsusb Command
- Listing USB devices with usb-devices Command
- Listing Block USB Devices
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.
Источник
Find USB device details in Linux/Unix using lsusb command
Today we will see how to list USB devices in Linux and their properties such as speed, BUS, class, type details etc. This is part of our on going hardware detection series. We already covered following stuff.
What is USB?
USB( Universal Serial Bus) is a stranded developed to replace different types of BUS’s available. This is a solution devices to eliminate vendor lock-down of hardware ports, so that BUS’s will be identical across different devices from different vendors. USB devices solve one more problem i.e. speeds. USB devices can reach up 5GB/s as of this writing where as PCI and serial devices have less speeds. Depending of USB firmware, it’s categorize in to USB 1.0, USB 2.0, USB 3.0. USB have competitor in the from of Thunderbolt interface.
As a Linux User/administrator we should know USB bus details as well as devices connected. In this post we will see how to use lsusb command to display different USB properties.
Learn lsusb command with examples
Example 1: List all the USB ports available
Let us try to understand above output in detail.
Bus 002 Device 003 : ID 0781:5567 SanDisk Corp. Cruzer Blade
Bus 002 : This is bus number where SanDisk USB stick is attached.
Device 003 : This is the third device attached to bus 002, the other two devices are “Linux Foundation 2.0 root hub” and ” Intel Corp. Integrated Rate Matching Hub”
ID 0781:5567 is the number given to this SanDisk, The number before : indicates the manufacture ID and number after : indicates device ID. To get more info on this visit Linux-USB site.
SanDisk Corp. Cruzer Blade is the name of manufacture and device name.
Example 2: Check how many USB ports available in your machine so that we can connect USB devices to these ports.
These ports may be internal or external to the system.
Example : Get detailed information of a USB device connected to a machine. Suppose I want to see information about /dev/bus/usb/002/005 device use below command
Output:
To know each of these types, click here.
Example 3: Get all the USB ports available and devices connected using verbose mode.
Example 4: List all mass storage devices in your system.
From the above output we can find that there are total three USB storage devices present on the machine.
Example 5: Find USB devices protocol version.
Depending on the version, the speed varies. Below table give you clear idea about the speeds associated with these versions.
USB 1.10 | 12Mb/s |
USB 2.00 | 480Mb/s |
USB 3.00 | 5Gb/s |
Example 6: Find USB device supported speeds by using tree structure option
In our next post we will see other hardware device properties.
Источник
List USB Devices Linux
In the world of USB computer peripherals, almost everyone uses some sort of USB devices in their computer. These days there are USB webcams, USB hard drives, USB stick also known as PenDrive etc. Almost every device has a USB version of it. So if you’re using Linux, listing what USB device is connected to your system might be necessary at some point.
There are many programs and many ways to list USB devices on Linux.
In this article, I will show you how to list USB devices on Linux. I am using Ubuntu 18.04 Bionic Beaver for the demonstration, but these commands are available on every Linux distribution. So let’s get started.
Listing USB Devices using lsusb Command
The widely used lsusb command can be used to list all the connected USB devices in Linux.
As you can see from the output of the lsusb command in the screenshot below, all the connected USB device is listed. The Bus ID, Device ID, USB ID, and a title is displayed in the output of lsusb command.
As you can see in the marked section of the screenshot below, Realtek Semiconductor Corp. with ID 0bda:57cb, this is my USB Webcam.
You can’t tell that it’s a Webcam by looking at the output of lsusb command, Can you? Nope! So how do I know this? It’s because I checked the output of the lsusb command before and after connecting the USB Webcam and once I compared the outputs, the newly added row is the USB device I connected. Plain! But there are ways to find out what the USB device is.
You can use the dmesg command to find out more information about the connected USB devices. The last connected USB device is the easiest to find with dmesg command. It is more widely used for debugging purpose. You will shortly see why.
You run dmesg command as follows:
As you can see in the yellow marked box in the screenshot below, these are information about the USB device I connected last, which was my USB Webcam. You can see in one of the blue marked box, the USB device I connected is a HD UVC WebCam and its ID is 0bda:57cb.
By now you may have found out that the output of dmesg command is system log messages. Well yes, it is.
You can also search for a specific USB device by its ID in the dmesg system log.
Run the following command to open the output of dmesg command with less text pager:
You should see the following window:
Now to search for a string, press / key on your keyboard. And you should the a / appear on the bottom of terminal window as marked in the screenshot below.
Now type in the USB device ID. For example, earlier when I listed the connected USB devices with lsusb command, one of the USB device had ID 0bda:57cb
Type in the USB Device ID and press . As you can see in the marked section of the screenshot below, the search string is marked white.
You may press and arrow keys to navigate up and down and read through it. You should find a lot of information about that USB device as you can see in the marked section of the screenshot below.
Listing USB devices with usb-devices Command
You can run the following command to list all the connected USB devices of your system:
As you can see in the screenshot below, all the connected USB devices are listed. we can find out pretty much the same information as before with usb-devices command.
Listing Block USB Devices
If you want to list all the USB block storage devices, that is all the USB storage devices, then you can use the lsblk or fdisk command to do so.
Listing USB block storage devices with lsblk:
As you can see in the screenshot below, all the available block storage devices (including the USB block storage devices) are listed.
You can get almost the same information as lsblk command with blkid command. But you have to run it as root as follows:
You can also use fdisk command to list all the USB block storage devices as follows:
As you can see in the screenshot below, the connected block storage devices (including the USB devices) are listed.
That’s how you list all the USB devices on Linux. Thanks for reading this article.
Источник