- Take me to the Video Tutorial
In this section, we will take a look at different types of files in linux.
- Everything is a file in Linux.
- Every object in linux can be considered to be a type of file, even a directory for example is a special type of file.
There are three types of files.
- Regular File
- Directory
- Special Files
Special files
are again catagorized into five other file types.
- Character Files
- These files represent devices under the
/dev
file system. - Examples include the devices such as the
keyboard
andmouse
.
- These files represent devices under the
- Block Files
- These files represent block devices also located under
/dev/
file system. - Examples include the
harddisks
andRAM
- These files represent block devices also located under
- Links
- Links in linux is a way to associate two or more file names to the same set of file data.
- There are two types of links
- The Hard Link
- The Soft Link
- Sockets
- A sockets is a special file that enables the communication between two processes.
- Named Pipes
One way to identify a file type is by making use of the file
command.
$ file /home/michael
$ flle bash-script.sh
$ file insync1000.sock
$ file /home/michael/bash-script
Another way to identify a file type is by making use of the ls -ld
command
ls -ld /home/michael
ls -l basg-script.sh