A Linux file system is a structured collection of files on a disk drive or a partition. Linux file system is generally a built-in layer of a Linux operating system used to handle the data management of the storage.
The Linux file system contains the following sections:
- The root directory (/)
- A specific data storage format (EXT3, EXT4, BTRFS, XFS and so on)
- A partition or logical volume having a particular file system.
The Root Directory
In Linux, the file system creates a tree structure. All the files are arranged as a tree and its branches. The topmost directory called the root (/) directory. All other directories in Linux can be accessed from the root directory.
Some of the directories include:
/bin: It contains the most basic commands. It is available to all users on the system. It is written in the binary format and binaries are represented in 0's and 1's.
/sbin: These are system binaries. It needs a super user permission to execute them. It can't be executed with a normal user.
/lib: This hold the libraries for binaries.
/usr: This was the original user location before the home directory was added. It also has /bin folder, /sbin folder, and /lib folder. The duplication is due to the historic reason of how this was designed originally in unix. Basically, because of the limitation in storage, making the duplicate of these folder to increase the storage size. The limitation does not exist anymore but the concept is still implemented.
local: This is located inside the /usr folder. It also has /bin, /sbin, /lib folders. Third party applications installed goes into the local folder and the applications will be split into the different folders inside the local folder. Any application installed here will be used by the particular user who installed it.
/opt: External applications installed goes here. The difference between the /opt directory and the /usr directory is that the /opt directory does not split applications into different folder. All applications installed are in one folder. Any application installed here will be used by all users.
/boot: This is basically for booting the system.
/etc: This is where the system configuration is stored. Unlike other directories, this directory is not a read only folder, so the configuration can be changed or are writable.
/dev: This stands for devices. Devices connected to your computer will be stored here.
/var: When the operating system starts, it logs some data which are stored in this folder.
/tmp: This stores temporary files for different applications which will be deleted later.
/media: External media is mounted into this folder and this external media will also be referenced in the /dev folder.
These directories are not usually interacted with by the user manually, the operating system or the package manager tool will interact with the folder.
There are hidden files in the home directory that are not seen by default. To see them, you can activate it in the settings. Hidden files are also called dot files because the file names start with dot. They are used to store configuration options. They are automatically created files.
Features Of The Linux File System
Linux does not use the backslash () to separate the components; it uses forward slash (/) as an alternative.
In Linux, we cannot tell whether we are addressing a partition, a network device, or an "ordinary" directory and a Drive.
Linux file system is case sensitive. It distinguishes between lowercase and uppercase file names. Such as, there is a difference between test.txt and Test.txt in Linux.
In Linux, a file may have the extension '.txt,' but it is not necessary that a file should have a file extension.
Linux distinguishes between standard files and hidden files, mostly the configuration files are hidden in Linux OS.
Types Of Linux File System
- Ext, Ext2, Ext3 and Ext4 file system
- JFS File System
- ReiserFS File System
- XFS File System
- Btrfs File System
- Swap File System
- Javatpoint, "https://www.javatpoint.com"
- Techworld with Nana Devops Bootcamp
Top comments (0)