Home » Questions » Computers [ Ask a new question ]

In Linux: How to get the device name of a USB port after a thumb drive has been inserted into it?

In Linux: How to get the device name of a USB port after a thumb drive has been inserted into it?

I have several USB ports on the front of my computer, and when I insert a thumb drive into one of them, it gets mounted temporarily in /media. I can navigate to its mount point directory in /media and treat it like any other directory, but for what I am trying to do, I need the thumb drive's /dev/___ name. How can I obtain this?

Asked by: Guest | Views: 341
Total answers/comments: 1
Guest [Entry]

"If its mounted to /media, the easiest trick is to just say

df /media/path

it will give you the /dev fs its mounted on

For more details you could do, (saving output to a file)

sudo lshw

and, look for the ""/media/path"" section in the output.
That will give you the association with more details."