Connected Devices
All Commands
mount
List Mounted Filesystems and Devices.
lsblk
List Block Devices and Their Partitions.
lsusb
List USB Devices and Hubs.
lspci
List PCI Devices (Peripheral Component Interconnect).
lsscsi
List SCSI Devices.
lsdev
List All Devices (AIX).
fdisk -l
List Partitions and Drives.
parted -l
List Partitions and Drives (with more details).
dmesg -H
Display Kernel Ring Buffer (includes device discovery messages).
udevadm info
Display Information about Devices Managed by Udev.
udevadm monitor
Monitor Udev Events for Device Changes.
ls /dev
List Device Files in the /dev Directory.
lshal
List HAL Devices (may need to be installed).
hwinfo --usb
Display USB Device Information (may need to be installed).
cat /proc/scsi/scsi
Display Information about SCSI Devices.
lspcmcia
List PCMCIA Devices (for systems with PCMCIA support).
df -h
Display Disk Usage and Free Space (includes mounted devices).
cat /proc/mounts
List Mounted Filesystems (alternative method).
blkid
Display Block Device Attributes, including UUIDs.
file -s /dev/<device>
Identify the Filesystem on a Device.
cat /proc/partitions
List Disk Partitions.
lsusb -t
Display USB Device Tree.
ls -l /sys/class/block
List Block Devices Using Sysfs.
usb-devices
List USB Devices and Their Details (may need to be installed).
lspcmcia -v
List PCMCIA Devices with Verbose Information.
ls /sys/class/hidraw
List HID (Human Interface Device) Raw Devices.
ls /sys/class/input
List Input Devices.
ls /sys/class/tty/ttyS*
List Serial (TTY) Devices.
lshw -class storage
List Storage Devices Using lshw
(requires installation).
smartctl -i /dev/<device>
Display Information about SMART Capable Devices.
lsblk -f
List Block Devices and Their Filesystem Types.
lsblk -o +SIZE
List Block Devices and Their Sizes.
ls -l /dev/input
List Input Devices Using Device Files.
ls -l /dev/serial/*
List Serial Devices (alternative method).
cat /proc/asound/cards
List Sound Cards.
cat /proc/tty/drivers
List TTY (Terminal) Drivers and Devices.
cat /proc/bus/input/devices
List Input Devices and Their Capabilities.
udevadm trigger
Force Udev to Re-Enumerate Devices.
udevadm settle
Wait for Udev to Settle After Device Changes.
udevadm info -q all -n /dev/<device>
Retrieve Detailed Information for a Device.
cat /sys/class/hidraw/hidraw*/device/uevent
List HIDRAW Devices.
find /sys/class/ -name 'sd*'
List SCSI Disk Devices.
Identify USBs/External Storage
mount
List Mounted Filesystems and Devices.
dmesg | grep -i 'usb'
Display USB device-related messages in the kernel ring buffer.
dmesg | grep -i 'sd'
Display messages related to SCSI disks in the kernel ring buffer.
lsblk
List block devices and their partitions.
lsusb
List USB devices and hubs.
lsusb -t
Display USB Device Tree.
ls -l /dev/disk/by-id/
List disk devices by their unique IDs.
fdisk -l
List partitions and drives.
blkid
Display block device attributes, including UUIDs.
udevadm info -q all -n /dev/sdX
Retrieve detailed information about a specific block device.
File Locations
/dev/
Unix systems create device files in the /dev/ directory to represent connected devices.
/sys/
The /sys/ directory is a virtual filesystem that exposes information about connected devices and their attributes.
/proc/mounts
This file contains information about mounted filesystems, including external storage devices.
/proc/scsi/
Information about SCSI devices, including external storage devices, can be found in the /proc/scsi/ directory.
udev Rules
The udev subsystem manages devices and their associated information. Udev rules can be configured to perform actions when devices are connected or disconnected.
/var/log/
System log files, such as those located in /var/log/, may contain information about connected devices.
Last updated
Was this helpful?