ls -l output in /dev directory of Unix/Linux system

these are major, minor numbers, more info on which you can find here : http://www.makelinux.net/ldd3/chp-3-sect-2.shtml

Traditionally, the major number identifies the driver associated with the device. For example, /dev/null and /dev/zero are both managed by driver 1, whereas virtual consoles and serial terminals are managed by driver 4; similarly, both vcs1 and vcsa1 devices are managed by driver 7. Modern Linux kernels allow multiple drivers to share major numbers, but most devices that you will see are still organized on the one-major-one-driver principle.

The minor number is used by the kernel to determine exactly which device is being referred to. Depending on how your driver is written (as we will see below), you can either get a direct pointer to your device from the kernel, or you can use the minor number yourself as an index into a local array of devices. Either way, the kernel itself knows almost nothing about minor numbers beyond the fact that they refer to devices implemented by your driver.


As @Daemon mentioned, these are major and minor numbers. The major numbers are common to a particular type of device.

For instance, running:

ls -l /dev | grep -P "tty\d$"

Produces:

crw--w----  1 root tty     4,   0 May 26 23:41 tty0
crw--w----  1 root tty     4,   1 May 26 23:41 tty1
crw--w----  1 root tty     4,   2 May 26 23:41 tty2
crw--w----  1 root tty     4,   3 May 26 23:41 tty3
crw--w----  1 root tty     4,   4 May 26 23:41 tty4
crw--w----  1 root tty     4,   5 May 26 23:41 tty5
crw--w----  1 root tty     4,   6 May 26 23:41 tty6
crw--w----  1 root tty     4,   7 May 26 23:41 tty7
crw--w----  1 root tty     4,   8 May 26 23:41 tty8
crw--w----  1 root tty     4,   9 May 26 23:41 tty9

Those all share the major number 4 but have different minor numbers.

Tags:

Linux