Development > Scripting and Bash

ls /dev

<< < (4/4)

No problem :)

Sent from my Mobile phone using Tapatalk

@Jerry Thank You :)

I use dmesg -wH for freshly plugged in devices.

Sent from my Mobile phone using Tapatalk


In Chapter 15 of , The Linux Command Line, there is a command -

--- Code: ---sudo tail -f /var/log/messages
--- End code ---

It should produce a list and then a SD card is added , it is an example of how the kernel will notice the device and probe it. I can follow the example in the book.
When I run this command (which is not an exercise in the book but I wanted to see it in action) I cannot get a result in terminal myself to then add a USB stick and watch this in action. Maybe the path needs to be different ?

Earlier in the Chapter I had read this -
"quote of Mr.Shotts - First let's look at how the system names devices. If we list the contents of the /dev directory (where all devices live), we can see that there are lots and lots of devices:

--- Code: ---ls /dev
--- End code ---

This gave me an idea to experiment using the above command, I was trying this below code to determine newly added device names by comparison -

--- Code: ---ls /dev/sd*
--- End code ---
My belief was it would show only those with sd naming using the wildcard *, I had learned previously in earlier chapters of "The Linux Command Line" about sd,  and about using wildcard.

Below is a screenshot of my output, and source of my question

As you can see I ran the code , I then inserted a USB stick and used up arrow on keyboard to reuse the same code and run it again, thus allowing for a comparison of before and after adding the USB stick.
It produced 2 new results the /dev/sdb and the /dev/sdb1 rather than the 1 new result I was expecting, why is this ?


[0] Message Index

[*] Previous page

Go to full version