What are the Different File Types in the Linux System

The Linux file system is distinct from the file systems of other operating systems because of the various file types. The file types in Linux referred to as normal files and directories are also familiar to other operating systems. However, the following are additional types of files that are UNIX-specific:

  • Normal Files
  • Directories
  • Device Files
  • Links
  • Sockets
  • FIFOs

Normal Files

Normal files refer to files as they are also known to other operating systems: a set of contiguous data addressed with one name. This includes all the files normally expected under this term (ASCII texts, executable programs, graphics files, etc.). The names for such files can basically be freely chosen and there is no division into the file name and file type (such as report.txt).

A number of file names still retain this structure, but these are requirements of the corresponding applications, such as a word processing program or a compiler.

Directories

Directories contain two entries with which the structure of the hierarchical file system is implemented. One of these entries (“.”) points to the directory itself. The other entry (“..”) points to the entry one level higher in the hierarchy.

Device Files

Each piece of hardware in a Linux system is represented by a device file. These files represent links between the hardware components or the device drivers in the kernel and the applications. Every program that wants to access hardware must access it through the corresponding device file. The programs write to or read from a device file. The kernel then ensures that the data finds its way to the hardware or can be read from the file.

Links are references to files located at other points in the file system. Data maintenance is simplified through the use of such links. Changes only need to be made to the original file. The changes are then automatically valid for all links.

Sockets

A socket refers to a special file with which data exchange between two locally running processes can be implemented through the file system.

FIFOs

FIFO (first in first out) or named pipe is a term used for files used to exchange data between processes. However, the file can only exchange data in one direction.