Day 3 of My 90-Day DevOps Challenge: Exploring the Linux File System & Some Basic Linux Commands

ยท

3 min read

Hello everyone! ๐Ÿ‘‹ On Day 3 of my DevOps journey, Iโ€™m delving into the Linux file system. Understanding the file system is crucial for navigating and managing a Linux environment effectively.

The Linux File System

In Linux, everything is treated as a file. This includes:

  • Ordinary Files: Files that contain data directly, such as text files, executable files, images, etc.

  • Directory Files: Folders that contain other files and directories.

  • Device Files: Files that represent hardware devices (e.g., /dev/sda for a hard disk).

Understanding the Linux File System Hierarchy

Introduction

The Linux file system hierarchy organizes the storage of data and system files in a structured manner. Each directory serves a specific purpose, making it easier to locate and manage files, applications, and configurations.

Linux Directory Structure Explained for Beginners

Key Directories in Linux

1. / (Root Directory)

  • The root directory is the top-level directory in Linux.

  • Example: /

2. /bin (Binaries)

  • Stores essential command binaries that are needed for system boot and repair.

  • Example: /bin/bash (the Bash shell)

3. /boot (Boot Loader Files)

  • Contains files required for booting the system, including kernel and bootloader configurations.

  • Example: /boot/vmlinuz-5.4.0-91-generic (Linux kernel)

4. /dev (Devices)

  • Contains device files that represent physical and virtual devices.

  • Example: /dev/sda (first SATA drive)

5. /etc (Configuration Files)

  • Holds system-wide configuration files for installed applications and services.

  • Example: /etc/passwd (user account information)

6. /home (User Home Directories)

  • Stores personal user directories where users store their files and configurations.

  • Example: /home/user1

7. /lib (Libraries)

  • Contains shared library files needed by the essential binaries in /bin and /sbin.

  • Example: /lib/x86_64-linux-gnu/libc.so.6 (C library)

8. /mnt (Mount Points)

  • Provides temporary mount points for mounting external filesystems or devices.

  • Example: /mnt/usb (mount point for a USB drive)

9. /proc (Process Information)

  • Virtual file system that provides information about running processes and system resources.

  • Example: /proc/cpuinfo (CPU information)

10. /sys (System Information)

  • Virtual file system that exposes kernel and hardware device information.

  • Example: /sys/class/net/eth0/ (network interface information)

11. /tmp (Temporary Files)

  • Stores temporary files created by system processes and users.

  • Example: /tmp/file.txt

12. /usr (User Programs)

  • Contains user binaries, libraries, documentation, and resources for installed programs.

  • Example: /usr/bin/python3 (Python interpreter)

13. /var (Variable Files)

  • Holds variable data files that are expected to change during normal system operation.

  • Example: /var/log/syslog (system log file)

Real-world Examples

  • Navigating the File System: Using commands like cd, ls, and pwd to move around and explore directories.

  • Managing Files: Creating, editing, and deleting files using commands like touch, nano, rm, and mv.

  • System Administration: Editing configuration files in /etc to customize system behavior.

Linux Commands:

You can watch this video and practice the linux commands , Every commands had been explained in detail you can go through this video and get clarity on each command use case.

As I continue my DevOps challenge, I look forward to exploring more about Linux and sharing my insights with you all. Stay tuned for more updates on my journey!

ย