Linux file system

All resources managed by the operating system, such as network interface cards, disk drives, printers, I/O devices, ordinary files, or directories, are treated as a file.

inode

The smallest unit of storage on a hard disk is a sector. A block consists of multiple sectors. A file is too large to be stored in multiple blocks, but a block can only store one file. The inode stores meta-information about a file, such as the file is divided into blocks, the address of each block, the owner of the file, the time of creation, permissions, size, and so on. Use stat to view the inode information of a file.

Linux file types

  • Normal files: Stores information and data that Linux users can view, change, or delete based on their access rights.
  • Directory files: used to represent and manage files, including file names and subdirectory names, open the directory is actually open directory files.
  • Symbolic link file: Retains the address to the file.
  • Character device: used to access character devices such as hard disks.
  • Device files: used to access block devices such as hard drives and floppy disks
  • Pipeline file: Used to communicate between processes
  • Sockets: Used for network communication between processes, but also for non-network communication between non-natives.