What is Linux File System?

There are mainly three types of files in the Linux system.

  • Regular files
  • Special Files
  • Directories

Regular Files

Regular files in Linux are the common files types such as human-readable text, program manual, and ASCII(American Standard Code For Information Interchange) characters.

Below are some of the regular files.

  • Text files such as CSV(Comma Seperated Values) and TSV(Tab Seperated Values) and files having .txt extension
  • Zipped/Compressed Files with .zip,.gzip extensions
  • Binary and PDF(Portable Document Format) files

Special Files

Special files are those files that are used for System uses. These can be files produced by physical devices such as mounted volumes, printers, CD drives, and any other Input/Output devices.

Directories

In Linux operating system, directories are also a special file system that stores both the regular and special files in a certain order. Directories in Linux are similar to folders in Windows-based operating Systems. They follow a hierarchical order starting from the root directory.

The below diagram shows the directory structure in Unix/Linux

/ (system root)
 _______________________________|____________________________________
 |    |	    |	 |     |    |	    |	      |	   |	  |    |    |
bin/ boot/ dev/ etc/ home/ lib/ lost+found/ proc/ root/ sbin/ usr/ var/
 |    |     |    |     |    |       |         |    |      |    |    |
 |    |     |    |     |    |       |         |    |      |    |    |-> various
 |    |     |    |     |    |       |         |    |      |    |
 |    |     |    |     |    |       |         |    |      |    |-> Read only files
 |    |     |    |     |    |       |         |    |      |
 |    |     |    |     |    |       |         |    |      |-> Superuser Binaries
 |    |     |    |     |    |       |         |    |
 |    |     |    |     |    |       |         |    |-> User roots home dir
 |    |     |    |     |    |       |         |
 |    |     |    |     |    |       |         |-> system info etc.
 |    |     |    |     |    |       |
 |    |     |    |     |    |       |-> Orphan files (look here after crashes)
 |    |     |    |     |    |
 |    |     |    |     |    |-> System / programming libraries
 |    |     |    |     |
 |    |     |    |     |-> Contains the user accounts home directories
 |    |     |    |
 |    |     |    |-> System configuration files.
 |    |     |
 |    |     |-> Contains Devices file such as /dev/sda
 |    |
 |    |-> The kernel and kernel maps which are static boot files
 |
 |-> Executeble files. (binaries)



Linux Directory Description

DirectoriesDescription
/rootThis directory is the home directory for the user who is logged in as root.
/usrThis directory contains mainly user-accessible things like applications and user utilities.
/binThis directory contains systems and user binaries
/usr/lib or /usr/local/libThis directory contains system and user libraries
/boot This directory contains the kernel source-related files.
/varThis directory contains various log files of various system applications.
/etcThis directory contains System configuration-related files.
/homeThis directory contains all the user folders of that Linux system. This folder can include Documents, Music, Public, and Videos.
/optThis contains any packages that are an add-on to that Linux system
/mntThis directory includes subdirectories that are the access point for mounting devices like CD-ROMs or external hard drives.
/procThis is a virtual files system in Linux that contains information about the processes that are running currently. It’s created when the system is up and running and gets deleted when the Linux system is shit down.
/media This directory contains files for removable devices such as USB drivers.