Under Linux and UNIX each and every hardware device treated as a file. A device file allows to accesses hardware devices so that end users do not need to get technical details about hardware.
In short, a device file (also called as a special file) is an interface for a device driver that appears in a file system as if it were an ordinary file. This allows software to interact with the device driver using standard input/output system calls, which simplifies many tasks.
There are two types of device files based upon how data written to them and read from them is processed by the operating system and hardware:
Device file allows transparent communication between user space applications and computer hardware.
All device files are stored in /dev directory. Use cd and ls command to browse the directory:cd /dev/
ls -l
Simply use ls -l command:ls -l /dev
Look for file's type in the first column output.
A character device is marked with a c as the first letter of the permissions strings.$ ls -l /dev/console
A block device is marked with a b as the first letter of the permissions strings:$ ls -l /dev/sdb1