Linux Architecture & Commands: A Beginner's Guide

Today, I had the opportunity to deepen my understanding of the Linux system architecture. This exploration helped me see how different components work together to form a powerful operating system. Here, I'd like to share what I learned and my understanding of these essential topics.

The Five Layers of Linux Architecture

For my understanding, Linux architecture can be broken down into five distinct layers:
1. User Layer:

  • This is the layer where the end-user interacts with the system. Users can interact with applications through a graphical user interface (GUI) or directly with the system via the command-line interface (CLI). If using the CLI, users interact with the shell, the third layer.

2. Applications Layer:

  • This layer consists of various applications designed to perform specific tasks. Examples include web browsers, office suites like LibreOffice, and other software such as Firefox. These applications make it easier for users to perform their desired tasks without needing to interact directly with the underlying system.

3. Shell Layer:

  • The shell acts as a bridge between the user and the kernel. It is the CLI where users write commands to execute specific tasks. The shell interprets these commands and sends them to the kernel for execution. Different shells are available in Linux, such as Bash, Zsh, and Fish.

4. Kernel Layer:

  • The kernel is the core or the heart of the Linux operating system. It manages system resources and hardware, executes commands, and processes the instructions provided by the user through the shell or applications. The kernel handles tasks such as memory management, process scheduling, and hardware communication.

5. Hardware Layer:

  • This is the foundational layer consisting of physical components like the CPU, memory, storage devices, and peripheral devices. The hardware layer provides the essential resources needed for the operating system to function.

    For Understanding Diagram is below:

  • I had an amazing time diving into some fundamental Linux commands. It reminded me of the excitement I felt when I wrote my first "Hello World" program. Here’s a brief overview of what I explored:

    1. echo "hello Raees": Prints "hello Raees".

    2. ls: Lists the contents of a directory.

    3. pwd: Displays the present working directory.

    4. whoami: Shows the current logged-in user.

    5. mkdir: Creates a new directory.

    6. touch: Creates a new file, like a .txt file.

    7. cd: Changes the directory.

      1. cd /: Takes you to the root directory.

      2. cd bin: Enters the bin directory.

    8. df -h: Displays the storage usage of the machine in a human-readable format.

    9. Creating multiple directories is easy with mkdir Raees{0..5}.

    10. Deleting multiple directories is just as simple with rm -r Raees*.

Key Insights:

  • BIN Directory: Contains essential commands like cp, ping, and apt.

  • man Command: Provides detailed information about other commands. For example, man ping gives details about the ping command.

Home Directory:

  • Stores user-specific data.

Boot Directory:

  • Stores the bootloader, crucial for starting the OS.

  • Hierarchy: Power on → BIOS → Bootloader (GRUB) → Kernel Initialization → INIT.

This is a brief overview of my learning today. I hope you find it useful and as fascinating as I did. Keep exploring and happy learning!