Skip to main content
Engineering LibreTexts

09-C.3: Monitoring Devices in Linux

  • Page ID
    2.7 Explain the use and operation of Linux devices.

    The lsdev Command

    The lsdev gathers information about your computer's installed hardware from the /proc/interrupts, /proc/ioports and /proc/dma files, giving you a quick overview of which hardware uses what I/O addresses and what IRQ and DMA channels.

    The information used by the lsdev command is found in the the following files:

    • /proc/interrupts — Each logical CPU core and its associated interrupt requests (IRQ) is listed in this file. A device will send an interrupt to the processor to inform the processor that the hardware needs to perform some task. The file lists how many signals were sent to each CPU core through one of the many IRQ addresses in the system. The name of the hardware device that is mapped to each IRQ address is also listed.
    • /proc/ioports —This file provides a list of currently registered port regions used for input or output communication with a device.
    • /proc/dma —This file contains a list of the registered ISA DMA channels in use

    The lsusb Command

    The lsusb command in Linux is used to display the information about USB buses and the devices connected to them. The properties displayed are speed, BUS, class, type details, etc. This information is gathered by scanning the /dev/bus/usb for information about the connected device, the device id, and vendor information.


    lsusb [ OPTIONS ] - probably the most used option is -V which provides a very verbose output for each device.


    pbmac@pbmac-server $ lsusb
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
    Bus 004 Device 003: ID 413c:2006 Dell Computer Corp. 
    Bus 004 Device 002: ID 413c:1004 Dell Computer Corp. 
    |------|              |--------| |------------------|
    Bus number            Device ID   Vendor and product info

    The lspci Command

    The lspci command on Linux systems is a utility for displaying information about PCI buses in the system and devices connected to them. By default, it shows a brief list of devices. Use the options described below to request either a more verbose output or output intended for parsing by other programs.


    lspci [ OPTIONS ]


    pbmac@pbmac-server $ lspci
    00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03)
    00:01.0 PCI bridge: Intel Corporation 4 Series Chipset PCI Express Root Port (rev 03)
    00:19.0 Ethernet controller: Intel Corporation 82567LM-3 Gigabit Network Connection (rev 02)
    00:1d.7 USB controller: Intel Corporation 82801JD/DO (ICH10 Family) USB2 EHCI Controller #1 (rev 02)
    00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a2)
    00:1f.2 RAID bus controller: Intel Corporation SATA Controller [RAID mode] (rev 02)
    00:1f.3 SMBus: Intel Corporation 82801JD/DO (ICH10 Family) SMBus Controller (rev 02)
    01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV620 LE [Radeon HD 3450]

    The lpq Command

    The lpq command shows the current print queue status on the named printer. Jobs queued on the default destination will be shown if no printer or class is specified on the command-line. The +interval option allows you to continuously report the jobs in the queue until the queue is empty; the list of jobs is shown once every interval seconds.


    lpq [ OPTIONS ]


    pbmac@pbmac-server $ lpq  
    printer is ready and printing  
    Rank    Owner   Job     File(s)                         Total Size  
    active  patm    603     (stdin)

    Adapted from:
    "lspci" by Multiple ContributorsWikipedia is licensed under CC BY-SA 3.0
    "lsusb command in Linux with Examples" by basilmohamed, Geeks for Geeks is licensed under CC BY-SA 4.0

    • Was this article helpful?