In Linux/UNIX, ever thing is a file. Here devices, drivers etc., are treated as files.
The following are the types of files available in Linux / UNIX.
Types of device files:
Ex: keyboard, mouse, monitor etc.,
Ex: cdrom, floppy, hard disk etc.,
Types of linked files:
There are many ways to figure out what type of file it is.
Using "file" command we can find out if it’s a file or directory etc.
By using ls –l (longlist format) command also we can determine the type of the file.
The starting letter of ls -l output, in each and every line indicates the type of the file.
In the above outputs the first letter in each and every line indicates the type of the file
- Regular file or ASCII text file
d Directory file or device file
c character special file
b block special file
l linked file
s socket file