DEV Community

Bijay Kumar Pun
Bijay Kumar Pun

Posted on

2

Linux Test Session: Listing hardware device with $ls*

$lshw

List hardware

$lsblk

List block devices
[There are two types of devices; block and character. Block devices reads data in chunks while character devices reads in character ]

$lsusb

List usb devices

Combine to $less for better control

Eg: $lshw | less

When a new device is connected but not recognized:

  1. Check if the device is listed in /dev/
  2. Count the listing before and after the device is connected *$ls /dev/ | wc -l This gives word count that should be different when new device is detected

Alt Text

When a 4gb memory card was inserted


$dmesg

This generally tells what's happening.
(kernel ring buffer)

https://askubuntu.com/questions/285539/detect-and-mount-devices


Other ways to know about devices

dmesg
sudo fdisk OR sudo fdisk -l
sudo blkid
lsblk
mount
lsusb
usb-devices
df -h
Enter fullscreen mode Exit fullscreen mode

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay