Linux all access to files, in addition to ordinary files and directory files, but also include some other special files: block device files, character device files, socket files, linked files and so on. Today, we mainly talk about common block device files and character device files, these 2 classes are the most common device file classes.
Devices commonly have mouse, keyboard, monitor, hard disk and so on. Where the hard disk is a block device, the mouse, keyboard, terminal, etc. is a character device. These devices in Linux are also in the form of files, exist in the directory/dev/, these device files do not occupy disk space, only one inode to represent, mainly record the device file information, including the main device number and secondary device number and other information. The main device number refers to the device main type, such as a hard disk or a serial port, marking a class of devices, these devices with a driver on the line; The secondary device number indicates the same device in different device individuals, such as there are 3 serial ports, each serial port of the main device number, the device number is different for different serial port.
Character device files
Examples, such as terminals.
Block device files
For example, a hard drive is typical.
Linux Disk Management Device file 04