Understanding Linux File System

3
219
Understanding Linux File System

Hello friends today i will be talking about the Linux File System in this post I will be talking about what is a Linux file system and how it works so a big thanks goes to  Ahmed Alkabary how explained the full file system in depth for all the beginners to understand so here is the video of it so you can see it  and understand it better :-

How Does It Work?

Friends so the Linux File System works on a tree-like structure and it just works like a tree as starts from the Root dir to the child dirs.

LINUX for Beginners

Understanding Linux File System

Unix uses a hierarchical file system structure, much like an upside-down tree, with root (/) at the base of the file system and all other directories spreading from there.

A Unix filesystem is a collection of files and directories that has the following properties −

  • It has a root directory (/) that contains other files and directories.
  • Each file or directory is uniquely identified by its name, the directory in which it resides, and a unique identifier, typically called an inode.
  • By convention, the root directory has an inode number of 2 and the lost+found directory has an inode number of 3. Inode numbers 0and 1 are not used. File inode numbers can be seen by specifying the -i option to ls command.
  • It is self-contained. There are no dependencies between one filesystem and another.

The directories have specific purposes and generally hold the same types of information for easily locating files. Following are the directories that exist on the major versions of Unix −

Sr.No. Directory & Description
1 /

This is the root directory which should contain only the directories needed at the top level of the file structure

2 /bin

This is where the executable files are located. These files are available to all users

3 /dev

These are device drivers

4 /etc

Supervisor directory commands, configuration files, disk configuration files, valid user lists, groups, ethernet, hosts, where to send critical messages

5 /lib

Contains shared library files and sometimes other kernel-related files

6 /boot

Contains files for booting the system

7 /home

Contains the home directory for users and other accounts

8 /mnt

Used to mount other temporary file systems, such as cdrom and floppy for the CD-ROM drive and floppy diskette drive, respectively

9 /proc

Contains all processes marked as a file by process number or other information that is dynamic to the system

10 /tmp

Holds temporary files used between system boots

11 /usr

Used for miscellaneous purposes, and can be used by many users. Includes administrative commands, shared files, library files, and others

12 /var

Typically contains variable-length files such as log and print files and any other type of file that may contain a variable amount of data

13 /sbin

Contains binary (executable) files, usually for system administration. For example, fdisk and ifconfig utlities

14 /kernel

Contains kernel files