Taking a look at the purpose of each individual Linux system folder
Welcome back to another tutorial from our Alpine Linux explorations tutorial series.
This time we are going to take a look at the purpose of each individual Linux system folder.
Linux systems have a specific directory structure that follows the Filesystem Hierarchy Standard (FHS).
Each directory serves a particular purpose and contains specific types of files:
/ (root): The root directory is the top-level directory of the filesystem hierarchy. All other directories are either directly or indirectly contained within it.
/bin: This directory contains essential binary files (executables) required for system boot and basic command-line operations. Common system utilities, such as ls, cp, and rm, are typically found here.
/boot: The /boot directory contains files related to the system boot process, including the kernel, bootloader configuration, and initial RAM disk (initrd) files.
/dev: The /dev directory contains device files, which represent hardware devices and interfaces on the system. These files allow access to various devices, such as hard drives, USB devices, terminals, and network interfaces.
/etc: The /etc directory stores system configuration files. It contains various configuration files for the system, services, applications, and network settings. Examples include /etc/passwd for user account information and /etc/network/interfaces for network configuration. Also here we can find the /etc/apk/repositories configuration file for our APK package manager used by Alpine Linux.
/home: The /home directory is the location where user home directories are typically stored. Each user on the system has a subdirectory within /home that provides a private space for storing personal files and configurations.
/lib and /lib64: These directories store shared libraries required by the system and applications. /lib is used for 32-bit libraries, while /lib64 is used for 64-bit libraries on systems that support it.
/media: The /media directory is used as a mount point for removable media devices, such as USB drives and optical discs. When a device is inserted, it is typically automatically mounted under /media for easy access.
领英推荐
/mnt: The /mnt directory serves as a general-purpose mount point for temporary or manually mounted filesystems. It is often used by system administrators for mounting external filesystems or network shares.
/opt: The /opt directory is used for optional software packages and applications that are not part of the core system. Third-party software and self-contained application packages are typically installed here.
/proc: The /proc directory provides a virtual filesystem that contains information about running processes and system configuration. It exposes system and process details as files, allowing easy access for monitoring and debugging.
/sbin: Similar to /bin, the /sbin directory contains essential system binaries. However, these binaries are typically used for system administration tasks and require elevated privileges.
/srv: The /srv directory is intended for site-specific data or files served by the system. It is commonly used for storing data associated with network services, such as web server content, FTP files, or data shared across a network.
/tmp: The /tmp directory is a location for temporary files that are created and used by various programs and processes. Files in /tmp are generally expected to be deleted upon system reboot.
/usr: The /usr directory contains user-accessible system files and programs. It includes subdirectories such as /usr/bin for user binaries, /usr/lib for libraries, /usr/share for shared data, and /usr/local for locally-installed software.
/var: The /var directory holds variable data that changes during system operation. It includes log files (/var/log), spool directories (/var/spool), package caches (/var/cache), and other dynamic data.
The directory structure may vary slightly between different distributions.
Now we can use the 'poweroff' command to shut down our Alpine Linux system.
Well, that was most enjoyable. See you in the next tutorial!?#linux