From aaf69b1adc47dbfc221759432f6c9ca00440c93f Mon Sep 17 00:00:00 2001 From: DHARAKA METH <130528796+DHARAKA-METH@users.noreply.github.com> Date: Thu, 14 Aug 2025 00:23:08 +0530 Subject: [PATCH] Fix content issue for DevOps learning path (Fixes #10) --- .../linux-directory-structure.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 Week 1 - Linux Fundamentals/02_Navigation_and_File_System/linux-directory-structure.md diff --git a/Week 1 - Linux Fundamentals/02_Navigation_and_File_System/linux-directory-structure.md b/Week 1 - Linux Fundamentals/02_Navigation_and_File_System/linux-directory-structure.md new file mode 100644 index 0000000..dabc359 --- /dev/null +++ b/Week 1 - Linux Fundamentals/02_Navigation_and_File_System/linux-directory-structure.md @@ -0,0 +1,132 @@ +# Linux Filesystem Structure + +--- + +## 1 `/` – Root Directory +**Purpose:** The root directory (`/`) is the top-level directory in the Linux filesystem, from which all other directories branch. +**Examples:** `/etc`, `/home`, `/usr`, `/var` + +--- + +## 2 `/bin` – Essential Binaries +**Purpose:** The `/bin` directory contains essential command-line binaries that are required for all users to operate the system. +**Examples:** `/bin/ls` (list files), `/bin/cp` (copy files), `/bin/mkdir` (create directories) + +--- + +## 3 `/sbin` – System Binaries +**Purpose:** The `/sbin` directory contains system administration binaries that are mainly used by the root user for maintenance and recovery tasks. +**Examples:** `/sbin/reboot`, `/sbin/fdisk`, `/sbin/ifconfig` + +--- + +## 4 `/etc` – Configuration Files +**Purpose:** The `/etc` directory stores system-wide configuration files for managing settings and services on the system. +**Examples:** `/etc/passwd` (user accounts), `/etc/hostname`, `/etc/ssh/sshd_config` + +--- + +## 5 `/home` – User Home Directories +**Purpose:** The `/home` directory stores personal files and settings for individual users, with each user having a separate subdirectory. +**Examples:** `/home/user/Documents/report.docx`, `/home/user2/.bashrc` + +--- + +## 6 `/usr` – User Programs & Data +**Purpose:** The `/usr` directory contains installed applications, libraries, and shared resources that are used by users. +**Examples:** `/usr/bin/python3` (Python), `/usr/lib/libc.so` (C library), `/usr/share/doc` (documentation) + +--- + +## 7 `/var` – Variable Data +**Purpose:** The `/var` directory stores files that frequently change during system operation, such as logs, mail, and scheduled jobs. +**Examples:** `/var/log/syslog` (logs), `/var/mail/user` (mail), `/var/spool/cron` (scheduled jobs) + +--- + +## 8 `/tmp` – Temporary Files +**Purpose:** The `/tmp` directory is used to store temporary files created by applications, which are usually cleared when the system reboots. +**Examples:** `/tmp/file1234.tmp` + +--- + +## 9 `/dev` – Device Files +**Purpose:** The `/dev` directory contains special files that represent hardware devices or virtual devices, allowing programs to communicate with them as if they were regular files. +**Examples:** `/dev/sda` (first hard disk), `/dev/tty1` (first terminal), `/dev/null` (discard data) + +--- + +## 10 `/opt` – Optional Software +**Purpose:** The `/opt` directory is used to store optional or third-party software packages that are not part of the core system. +**Examples:** `/opt/google/chrome`, `/opt/eclipse` + +--- + +## 11 `/lib` – Essential Libraries +**Purpose:** The `/lib` directory contains essential shared libraries that are required for binaries in `/bin` and `/sbin` to run. +**Examples:** `/lib/x86_64-linux-gnu/libc.so.6`, `/lib/modules/` + +--- + +## 12 `/boot` – Boot Files +**Purpose:** The `/boot` directory contains the kernel and bootloader files that are needed to start the operating system. +**Examples:** `/boot/vmlinuz-6.0` (kernel), `/boot/grub/grub.cfg` (GRUB config) + +--- + +## 13 `/mnt` – Temporary Mount Points +**Purpose:** The `/mnt` directory is used for temporarily mounting external devices such as USB drives or network shares. +**Example:** `/mnt/usb` + +--- + +## 14 `/srv` – Service Data +**Purpose:** The `/srv` directory stores data for services provided by the system, such as web or FTP servers. +**Example:** `/srv/www` for a web server + +--- + +## 15 `/proc` – Process & Kernel Info +**Purpose:** The `/proc` directory is a virtual filesystem that provides runtime information about processes and the kernel, which is useful for monitoring system state. +**Examples:** `/proc/cpuinfo` (CPU info), `/proc/meminfo` (memory info) + +--- + +## 16 `/run` – Runtime Data +**Purpose:** The `/run` directory stores temporary runtime data such as PIDs, sockets, and other information needed while the system is running. +**Examples:** `/run/sshd.pid`, `/run/user/1000` + + + + + +# Linux Filesystem Structure - ASCII Tree +``` +/ +├── bin # essential binaries +├── sbin # system binaries +├── etc # configuration files +├── home # user directories +│ ├── user1 +│ └── user2 +├── usr # user programs, libraries, and shared resources +│ ├── bin +│ ├── lib +│ └── share +├── var # variable data +│ ├── log +│ ├── mail +│ └── spool +├── tmp # temporary files +├── dev # device files +├── opt # optional software +├── lib # essential libraries for /bin and /sbin +├── boot # boot files (kernel and bootloader) +├── mnt # temporary mount points +├── srv # service data +├── proc # process and kernel info (virtual filesystem) +└── run # runtime data (PIDs, sockets, etc.) + +``` + +