09-21-2018, 03:55 PM
Hello,
In Chapter 15 of , The Linux Command Line, there is a command -
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:
"
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 -
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 ?
In Chapter 15 of , The Linux Command Line, there is a command -
Code:
sudo tail -f /var/log/messages
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
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*
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 ?