Linux - Devices and Drivers

In Linux, everything is considered a ​file, even hardware devices. ​When a device is connected to your computer, ​a device file is created in the /dev directory. ​ Pasted image 20260623085837

Block devices: A system that acts like USB drives and hard drive by transmitting data

Character devices: A way to transmit data character by character like a keyboard and mouse

Pipe devices: Similar to character devices. However, pipe devices send output to a process running on the Linux machine instead of a monitor or printer.

Socket devices: Similar to pipe devices. However, socket devices help multiple processes communicate with each other.

Devices are located in the /dev directory in Linux. A few examples of devices you may find in the /dev directory include:

  • /dev/sda - First SCSI drive
  • /dev/sr0 - First optical disk drive 
  • /dev/usb - USB device
  • /dev/usbhid - USB mouse
  • /dev/usb/lp0 - USB printer
  • /dev/null - discard

How to check if a device is installed

There are a couple of methods for checking if a device is already installed on a Linux machine:

Through a user interface like GNOME

  1. In the GNOME user interface, open the Settings menu.
  2. Browse each device set on the left-side menu. 
  3. The attached devices of the selected device type will appear in the window pane on the right.

Through the command line

Here are some commands that list specific device types: 

  • $ ls /dev - Lists all devices in the /dev folder 
  • $ lcpci - Lists devices installed on the PCI bus 
  • $ lsusb - Lists devices installed on the USB bus
  • $ lsscsi - Lists SCSI devices, such as hard drives
  • $ lpstat -p - Lists all printers and whether they are enabled
  • $ dmesg - Lists devices recognized by the kernel