The Linux Filesystem

Linux file system is developed in such a way that simplifies storing, retrieving and managing files.
  •  Linux file system is generally built-in layer of a Linux operating system used to handle the data management of the storage.
  • It helps to arrange the file on the disk storage.
  • It manages the file name, file size, creation data, and much more information about a file.
  • Linux file system has a hierarchal file structure as it contains a root directory  and its subdirectories.
  • Linux file system contains two-part file system software implementation architecture. 
  • The file system requires an API (Application programming interface) to access the function calls to interact with file system components like files and directories. 
  • API facilitates task such as creating, deleting and copying the files. It facilitates an algorithms that defines the arrangements of files on a file systems.

  • In Linux, the file system creates a tree structure. 
  • The top most directory called the root(/) directory. 


Linux support two types of paths:
1. absolute path 
  • Absolute path is a complete path to a file or directory from the root directory. 
  • the root directory is the top-level directory of the file system and is represented by a forward slash(/).
  • Absolute paths always start with root directory and provide the full path to the file or directory.
  • for example: absolute to the home directory of a user named "kiran" would be "/home/kiran".
  • Absolute paths always point to same location regardless of the current directory
  • It is useful when you need to refer to a file or directory from anywhere in the system. 
 
2. relative path
  • Relative path is a path to a file or directory that is relative to the current directory. 
  • It specifies the location of the file or directory in relation to the current directory. 
  • It do not start with root directory and are usually shorter than absolute paths.
  • Relative paths may point to different locations depending on the current directory.
  • It is more convenient when you are working within a specific directory or subdirectory. they allow you to specify the location of a file or directory relative to your current location, which can save you time and typing.



1. Regular or ordinary files
  • It store data of various content types such as text, audio, video, images, scripts and programs.
  • This file can found in directories, which are yet another types of files.
  • In linux, regular files can exits with or without an extension.

2. Directory files
  • We know that Linux follows a hierarchical structure to organize files. This is achieved using directories. Directories are also Linux files. But rather than storing data, they store the location of other files. To achieve this, the directory uses directory entries
  • Each directory stores the name and location of a single file.  
  • All Linux directories have a parent directory, except the root.

3. Block files
  • This file are hardware files acting as a direct interface to block devices.
  • A block that performs data input and output operations in units of blocks.
  • It represents a device that transfers data in blocks such as a hard drive. 

4. Character device file
  • It is a hardware file that reads or writes data one character at a time in a file.
  • These file provides a serial stream of input or output and provide direct access to hardware devices. 

5. Names pipe file
  • It is also referred to as pipe file is sometimes called FIFO-First-In, First-Out.
  • It works on the principle that the order of bytes going in is the same as coming out.
  • The "name' of a named pipe is a file name with the file system.
  • This file is responsible for sending data from one process to another so that the receiving process reads the data in FIFO fashion.

6. Symbolic link file
  • A symbolic link file is a special file in Linux that points to another file or a folder.
  • link files ensure that we have the flexibility to use a file a different filename as well as from a different location.
  • A link file behaves like a pointer to another file.
Types of link are
1. Hard link 
  • Hard link cannot be created for a directory or a file on another filesystem.
2. Soft link
  • Soft link creates a pointer to the original file. A soft link can be created to a directory or a file on another filesystem.

7. Socket file
  • Applications use sockets to exchange data. A socket is just a communication endpoint that facilities this exchange.
  • When an application wants to interact with another it has to connect with the socket of the other application.
  • The application will use a socket to accept connections. 
  • Linux is on the constant lookout to smoothen the communication between local applications. For this it uses socket files. 
  • Socket files allows exchange of data without the complication process of networks and sockets. These special files use name as their address instead of IP and port number.

                                  





Comments