U NIX has a beautifully consistent method of allowing programs to access hardware. Under U NIX , every piece of hardware is a file. When you read from it, you are actually reading directly from the first physical hard disk of your machine.
Device files allow access to hardware.
This is an easy way to see if your mouse is working. Block and character devices Hardware devices can generally be categorised into random access devices like disk and tape drives, and serial devices like mouses, sound cards and terminals. Random access devices are usually accessed in large contiguous blocks of data that are stored persistently. These are known as block devices. Serial devices on the other hand are accessed one byte at a time.