Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-14-2009, 01:25 PM   #1
Registered: Nov 2007
Posts: 61

Rep: Reputation: 15
how can i know which device is which in /dev

I am having a doubt that when i see /dev directory, i found all the devices that are attached to the system, But how can i identify specific device in the list.??

For suppose i see tty------tty0 to tty68. Now how can i know what are all these devices?? about 70 devices are there in the entry. how can i identify them. Just by seeing the MAJOR number same for all those i can come to a conclusion that all are using the same driver, but according to the MINOR number how can i identify???
Old 01-14-2009, 03:26 PM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
I'm not sure what you're asking, but most of the "devices" in /dev are just placeholders for use when needed. If you're asking "Which tty entries are currently in use," something like this would tell you.
$ ps -ea | grep tty
 2599 tty4     00:00:00 mingetty
 2600 tty5     00:00:00 mingetty
 2601 tty2     00:00:00 mingetty
 2602 tty3     00:00:00 mingetty
 2603 tty6     00:00:00 mingetty
 2637 tty7     00:02:58 X
The actual device to which a tty is connected is determined when it's opened by the kernel, and the "number" used is seldom related to any physical device. As you can see in the listing above, on this laptop tty7 is connected to the X-server and tty[2-6] are connected to terminal consoles.
Old 01-14-2009, 03:28 PM   #3
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Rep: Reputation: 19
Well, I don't have any idea what your Linux knowledge level is, but the command
will list all attached USB devices. Otherwise
fdisk -l
will give you a list of all attached filesystems.

Hope that helps...
Old 01-14-2009, 09:50 PM   #4
Registered: Feb 2004
Location: Chaska, MN
Distribution: Fedora
Posts: 195

Rep: Reputation: 31
A viable way to identify a device is to use the "dmesg" command, grepping the output to the device you're looking for. For example, if you have two video input cards, say /dev/video0 and /dev/video1, you could run:

dmesg | grep video0

and hopefully, you could find some information, such as the driver, that could help identify the device.

Good luck!



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
device order (dev/sdb,dev/sdd) changes why ? comtmr Linux - Enterprise 5 06-26-2012 04:28 AM
Installing RIP LinuX on a USB drive - device name /dev/sdc becomes /dev/sda Mleahy Linux - Software 1 07-30-2008 08:57 PM
using flash drive changes device /dev/sr0 to /dev/sr1 for mapping to /dev/pktcdvd/0? lugoteehalt Linux - Software 3 10-24-2007 10:27 AM
startx --> (EE) xf86OpenSerial: Cannot open device /dev/input/mice No such device. TB2 Linux - Software 2 04-04-2007 05:11 PM
/dev/tty0, /dev/tty1, /dev/tty10...and so on...which should be used for a device ??? b0nd Slackware 2 04-02-2006 08:14 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration