The Linux Filesystem

 

Linux filesystem is used to handle the data management of the story.

It manages the filename, file size, creation date and much more information about a file.

The basic purpose of a filesystem is to represent and organize the system's storage resources.


Pathnames

It is a text string made up of one or more names separated by forward slashes.

It indicates how to find something in the hierarchical file system tree.

some examples: /home, /etc/passwd, etc... 

/ is also known as root directory.


Example of relative path

  • $pwd
  • /home/kt
  • $cd abc
  • $pwd
  • /home/kt/abc
Example of absolute path
  • $pwd
  • /home/kt
  • $cd /home/kt/abc
  • $pwd
  • /home/kt/abc
File types in Linux:

  1. Regular or ordinary files:  stores data of various content types such as text, audio, video, images, scripts, and programs.
  2. Directories: It is a binary file used to track and locate other files and directories.
  3. Special files: Character device and block device file: Exposes device as a file in the file system.
  • A special file provides a universal interface for hardware devices because tools for file I/O can access the device.
  • A special file represents a device that transfers data in bytes such as a monitor or a printer.
  • A block file represents a device that transfer data in blocks. It provides access to a device that transfers in groups of a fixed size.
  • A character special file that provides access to a device that transfers in increments of a single character.
      4. Link files: Hard link and soft link files: A link file is a pointer of another file which allows users  
          to use a file with a different filename and from a different location.
  • Hard link: Creates a mirror copy of the original copy and cannot be created to a directory.
  • Soft link or Symbolic: Link that points to a file by name that can be created to a directory. 
      5. Socket files:  It is a communication end point that application use to exchange data which makes            communication process easy.
          Each socket has an associated IP address and port number that allow it to accept connections                    from clients.  Socket files use the sendmsg() and recvmsg() system calls to enable inter-process              communications between local applications.
     6. Named pipes: Allow communication between two processes running on the same host. It is also               known as "FIFO files". It is similar to socket files.

Comments

Popular posts from this blog

Basic structures of a computer

Client Server Architecture

Fetch, execution and IO