Exploring the Linux Filesystem: A Comprehensive Guide
The Linux filesystem is a fundamental aspect of the operating system, providing a structured and organized way to manage files and directories. This comprehensive guide will take you through the entire Linux directory structure, starting from the top-level root directory (/).
Directories are structured in a tree-like hierarchy
Paths: Accessing directories is accomplished by using the sequentially deeper directory names connected by forward slashes (/) such as /var/log
There are two types of paths in Linux: absolute and relative.Absolute path
It always starts at the hard drive's root and contains all the information needed to find a file. For example, /home/ubuntu is an absolute path.
Relative path
Specifies the location of a file or directory relative to the current directory. Do not start with the root directory
/ (root filesystem)—>The root filesystem is the top-level directory
Contains all of the files required to boot the Linux system before other filesystems are mounted.
/bin——>directory contains user executable files.contains essentials user commands(ls,mv ..etc)
/boot——>Contains static bootloader and kernel executable and configuration files required to boot
/dev———>This directory contains the device files for every hardware device attached to the system(generated at boot time or even on the fly).
/etc———>system configuration files for the computer.
/home——> where you will find your users’ directories.
/lib———>Contains Librarie files containing code that your applications can use
/media——> External removable media are mounted
/opt———>Optional files such as vendor-supplied
/root———>This is not the root (/) filesystem. It is the home directory for the root user.
/sbin———>System binary files.
/tmp———Temporary directory used by the OS and many programs to store temporary files
/usr———>These are read-only user support application files, including executable binaries and libraries
/var———>Variable data files are stored here. This can include things like log files, database files, web server files and much more.
In conclusion, understanding the Linux filesystem is crucial for effectively managing and navigating files and directories within the operating system. By familiarizing yourself with the hierarchical structure and the purpose of each directory, you can enhance your efficiency and proficiency in using Linux.
Subscribe to my newsletter
Read articles from JansiGorle directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
JansiGorle
JansiGorle
I am currently working as a Technical Consulting Engineer at CISCO. An integral part of building, maintaining, and providing Cpaas solutions to the Customers. Cisco Webex Cpaas solution is a revolutionary product that changes the way customers Interact! Holding 2.5+years of experience in Software Development and have worked on world-class products such as Cisco Webex, Cisco Cpaas Solutions, etc... Passionate coder, learner, and problem solver.