The Linux folder structure is arranged in levels and follows a standard pattern. Knowing this structure helps with moving around, managing the system, and creating software. Here's a summary of important folders in the Linux file system:
/
(Root Directory):The root directory is the top-level directory in the file system.
All other directories and files are subdirectories or files contained within the root directory.
/bin
(Binary):Essential command binaries (programs) are stored here.
Common commands like
ls
,cp
, andmv
reside in this directory.
/boot
(Boot Loader Files):Files required for the system's boot process are stored here.
Includes the Linux kernel and boot loader configuration files.
/dev
(Devices):Device files for various hardware devices are located here.
Example:
/dev/sda
represents the first hard disk.
/etc
(Configuration Files):System-wide configuration files are stored here.
Configuration files for software applications and system settings are in this directory.
/home
(User Home Directories):Home directories for regular users are located here.
Each user has a subdirectory within
/home
containing their personal files.
/lib
(Libraries):Shared libraries needed for system binaries are stored here.
Essential libraries for the system and installed software are in this directory.
/media
and/mnt
(Removable Media and Mount Points):/media
typically contains mount points for removable media (e.g., USB drives)./mnt
is a common location for manually mounted file systems.
/opt
(Optional):Contains optional software packages that are not part of the default system installation.
Software installed in this directory is often self-contained.
/proc
(Process Information):A virtual file system containing information about system processes.
Files and directories in
/proc
provide information about running processes and kernel parameters.
/root
(Root User Home Directory):The home directory for the root user.
The root user is the administrative user with superuser privileges.
/sbin
(System Binaries):System binaries used for system administration and maintenance.
Commands in
/sbin
are generally intended for system administrators.
/srv
(Service Data):Data for services provided by the system is stored here.
For example, data related to a web server may be placed in
/srv
.
/sys
(Sysfs File System):- A virtual file system that exposes information about the kernel, devices, and other kernel-related information.
/tmp
(Temporary):Temporary files are stored here.
Files in
/tmp
are often deleted upon system reboot.
/usr
(User Binaries and Data):Contains the majority of user utilities and applications.
Subdirectories include
/usr/bin
,/usr/lib
,/usr/share
, etc.
/var
(Variable):Variable files—files whose content is expected to continually change during normal operation—are stored here.
Examples include log files (
/var/log
), spool files (/var/spool
), and temporary files (/var/tmp
).
This is a simple summary, and Linux systems might have more folders based on the version and installed programs. Knowing what each folder does is important for managing the system and fixing problems.