0xnhl

Linux

/ Update
12 min read

GNU/Linux is the complete, technically accurate name for the free, open-source operating system that most people simply call “Linux”.
It represents a highly successful combination of two separate, open-source software projects: the GNU project and the Linux kernel.

  • The GNU Project: Created by Richard Stallman in 1983, GNU provides the essential operating system tools, libraries, and utilities (like the shell, compiler, and core commands) needed to interact with a computer. GNU was also an operating system based on UNIX. However, it lacked a working kernel for a long time.
  • The Linux Kernel: Created by Linus Torvalds in 1991, Linux is the kernel that manages physical hardware, memory, and CPU resources. At the time, the UNIX operating system was already in use. He wanted to improve it and make it open source and accessible to anyone.
    Stallman shared Torvalds’ goal of creating software that was free and open to anyone. After working on GNU for a few years, the missing element for the software was a kernel. Together, Torvalds’ and Stallman’s innovations made what is commonly referred to as Linux.

Linux Architecture#

In the Linux world, the operating system treats almost everything as a file.

  • Your hard drive is a file.
  • Your keyboard and mouse are files.
  • Running processes are represented as files.
    Because everything uses the same simple text-based foundation, it makes the system incredibly predictable, lightweight, and easy to automate using text commands.

Hardware#

The hardware is the physical components of a computer.
Peripheral devices are hardware components that are attached and controlled by the computer system.
Internal hardware are the components required to run the computer. : MB,CPU,RAM,HDD.

Kernel#

The kernel is the component of the Linux OS that manages processes and memory. It communicates with the applications to route commands. The Linux kernel is unique to the Linux OS and is critical for allocating resources in the system. The kernel controls all major functions of the hardware, which can help get tasks expedited more efficiently.

The Linux kernel itself is monolithic, meaning all its core services run together in the same high-privilege memory zone for maximum performance. It is divided into five major subsystems:

  • Process Management: Controls the creation, execution, and destruction of processes. The system scheduler decides exactly which program gets to use the CPU, for how many milliseconds, ensuring smooth multitasking.
  • Memory Management: Maps the physical RAM chips to virtual memory addresses used by software. It prevents apps from stepping on each other’s data and manages “swap space” (using the hard drive as emergency RAM).
  • Virtual File System (VFS): The implementation of the “Everything is a file” concept. VFS provides a universal interface so that apps can read and write data the exact same way, whether that data lives on a local SSD (ext4), a Windows drive (NTFS), a USB stick (FAT32), or a network server.
  • Network Stack: Handles network protocols (like TCP/IP, UDP, and routing). It wraps application data into packets and unpacks incoming data from the physical network ports.
  • Device Drivers: The specialized code modules that know how to talk to specific pieces of physical hardware (like an NVIDIA graphics card or a Realtek Wi-Fi chip). Linux allows these drivers to be loaded and unloaded dynamically (Loadable Kernel Modules) without restarting the computer.

System Call Interface (SCI)#

When a program in User Space needs to perform a hardware task (like opening a file or sending a packet over Wi-Fi), it cannot execute that task directly. Instead, it triggers a System Call (Syscall).

  • The GNU C Library (glibc) translates standard code commands into these syscalls.
  • The CPU instantly switches from User Mode to Kernel Mode, the kernel performs the requested action safely, and control is handed back to the application.

GNU Utilities & C Library (glibc)#

The translation layer. The kernel speaks a very low-level language. GNU utilities provide the core commands (like copying files, moving directories, or launching programs) that allow software and users to talk to the kernel efficiently.

Filesystem Hierarchy Standard (FHS)#

The Filesystem Hierarchy Standard (FHS) is the component of the Linux OS that organizes data. It specifies the location where data is stored in the operating system. 
A directory is a file that organizes where other files are stored. Directories are sometimes called “folders,” and they can contain files or other directories. The FHS defines how directories, directory contents, and other storage is organized so the operating system knows where to find specific data. 

Shell#

The shell is the command-line interpreter. Everything entered into the shell is text based. The shell allows users to give commands to the kernel and receive responses from it. You can think of the shell as a translator between you and your computer. The shell translates the commands you enter so that the computer can perform the tasks you want.

Applications#

An application is a program that performs a specific task. A package manager is a tool that helps users install, manage, and remove packages or applications. A package is a piece of software that can be combined with other packages to form an application.

User#

The user is the person interacting with a computer. They initiate and manage computer tasks. Linux is a multi-user system, which means that multiple users can use the same resources at the same time.

User Space vs. Kernel Space#

The architecture enforces a strict boundary between user programs and the core system. This boundary is maintained by the computer’s CPU hardware using execution modes:

  • User Space (Ring 3): Where your daily applications run. Programs here have restricted privileges. A web browser cannot touch physical RAM or write directly to a hard drive; it must ask for permission. If Firefox crashes, it only crashes inside User Space—leaving the rest of the machine running safely.
  • Kernel Space (Ring 0): The inner sanctum where the Linux kernel executes. It has unrestricted, direct access to the physical hardware.

The User Interface#

  • Display Server: Handles the basic drawing of windows, mouse tracking, and keyboard inputs on your screen (using modern protocols like Wayland or older ones like X11).
  • Desktop Environment (DE): The visual wrapper. This includes your taskbars, application menus, desktop wallpapers, and windows. Popular examples include GNOME (sleek and modern) and KDE Plasma (highly customizable, similar to Windows).

Package Managers#

A package is a piece of software that can be combined with other packages to form an application. Some packages may be large enough to form applications on their own.
Packages contain the files necessary for an application to be installed. These files include dependencies, which are supplemental files used to run an application.
A package manager is a tool that helps users install, manage, and remove packages or applications. Linux uses multiple package managers.

Types of package managers#

Certain package managers work with certain distributions. For example, the Red Hat Package Manager (RPM) can be used for Linux distributions derived from Red Hat, and package managers such as dpkg can be used for Linux distributions derived from Debian.
Different package managers typically use different file extensions. For example, Red Hat Package Manager (RPM) has files which use the .rpm file extension, such as Package-Version-Release_Architecture.rpm. Package managers for Debian-derived Linux distributions, such as dpkg, have files which use the .deb file extension, such as Package_Version-Release_Architecture.deb.

Package management tools#

In addition to package managers like RPM and dpkg, there are also package management tools that allow you to easily work with packages through the shell. Package management tools are sometimes utilized instead of package managers because they allow users to more easily perform basic tasks, such as installing a new package. Two notable tools are the Advanced Package Tool (APT) and Yellowdog Updater Modified (YUM).

Advanced Package Tool (APT)#

APT is a tool used with Debian-derived distributions. It is run from the command-line interface to manage, search, and install packages.

Yellowdog Updater Modified (YUM)#

YUM is a tool used with Red Hat-derived distributions. It is run from the command-line interface to manage, search, and install packages. YUM works with .rpm files.

Shells#

shell is the command-line interpreter. You can think of a shell as a translator between you and the computer system.

Input and output in the shell#

Standard input: information received by the OS via the command line.
String data is data consisting of an ordered sequence of characters.
Standard output: information returned by the OS through the shell.
Standard error: contains error messages returned by the OS through the shell.

Filesystem Hierarchy Standard (FHS)#

Filesystem Hierarchy Standard (FHS) is the component of Linux that organizes data. The FHS is important because it defines how directories, directory contents, and other storage is organized in the operating system.
A file path is the location of a file or directory. In the file path, the different levels of the hierarchy are separated by a forward slash (/).

Root directory#

The root directory is the highest-level directory in Linux, and it’s always represented with a forward slash (/).  All subdirectories branch off the root directory. Subdirectories can continue branching out to as many levels as necessary.

Standard FHS directories#

  • /home:
    • Each user in the system gets their own home directory.
  • /bin:
    • This directory stands for “binary” and contains binary files and other executables. Executables are files that contain a series of commands a computer needs to follow to run programs and perform other functions.
  • /etc:
    • The etc folder (short for etcetera) is a commonplace location to store system files that are used by your operating system.
    • For example, the sudoers file highlighted in the screenshot below contains a list of the users & groups that have permission to run sudo or a set of commands as the root user.
  • /tmp:
    • Short for “temporary”, the /tmp directory is volatile and is used to store data that is only needed to be accessed once or twice. Similar to the memory on your computer, once the computer is restarted, the contents of this folder are cleared out.
  • /mnt:
    • This directory stands for “mount” and stores media, such as USB drives and hard drives.
  • /var:
    • The “/var” directory, with “var” being short for variable data, stores data that is frequently accessed or written by services or applications running on the system.
    • For example, log files from running services and applications are written here (/var/log), or other data that is not necessarily associated with a specific user (i.e., databases and the like).
  • /root:
    • Unlike the /home directory, the /root folder is actually the home directory for the “root” system user.

User-specific subdirectories#

  • Under home are subdirectories for specific users. Each user has their own personal subdirectories.
    Note: When the path leads to a subdirectory below the user’s home directory, the user’s home directory can be represented as the tilde (~).

  • The absolute file path is the full file path, which starts from the root.

  • The relative file path is the file path that starts from a user’s current directory.

Shell Commands#

Linux File permissions and ownership#

Linux authentication and authorization#

Linux networking#

Distributions#

A Linux distribution (or “distro”) is a complete operating system built on the Linux kernel. It bundles the kernel with essential system tools, desktop environments, and software packages. Different distros are tailored to specific users, ranging from everyday desktop setups to enterprise servers and cybersecurity.

Ubuntu#

UBUNTU® is a trademark of Canonical Ltd. and is Debian-based. It is one of the most popular open-source distributions, designed primarily for general desktop use, cloud computing, and enterprise servers. It is known for its user-friendliness and massive community support.

  • Desktop Environments: GNOME (default), KDE Plasma (Kubuntu), XFCE (Xubuntu)
  • Key Features: Advanced Package Tool (APT), Snap packages, Long-Term Support (LTS) releases

Arch Linux#

ARCH LINUX™ is an independently developed, lightweight distribution designed for competent Linux users. It follows a “Keep It Simple” (KISS) philosophy, providing a minimal base system where the user builds and customizes their own environment from scratch.

  • Package Management Tools: Pacman, Arch User Repository (AUR)
  • Key Features: Rolling-release model (always up-to-date), bleeding-edge software, highly customizable

Fedora#

FEDORA® is backed by Red Hat (IBM) and serves as the upstream source for Red Hat Enterprise Linux (RHEL). It is an innovative, open-source distro geared toward developers and open-source enthusiasts who want the latest stable software features.

  • Package Management Tools: DNF, RPM package manager, Flatpak
  • Key Features: Cutting-edge software features, strong focus on open-source philosophy, default Wayland display server

Linux Mint#

LINUX MINT™ is a community-driven distribution based on Ubuntu and Debian. It is designed to provide a classic, highly intuitive desktop experience out of the box, making it one of the top choices for beginners migrating from Windows or macOS.

  • Desktop Environments: Cinnamon (default), MATE, XFCE
  • Key Features: Pre-installed multimedia codecs, Mint Tools (Update Manager, Software Manager), highly familiar user interface

Debian#

DEBIAN® is an independent, community-driven distribution that serves as the foundation for many other distros (including Ubuntu and Kali). It is world-renowned for its strict adherence to free software philosophy and its legendary system stability.

  • Package Management Tools: APT, dpkg
  • Key Features: Massive software repositories, “Stable” release branch used heavily for servers, robust architecture support

Kali Linux#

KALI LINUX™ is a trademark of Offensive Security and is Debian derived. This open-source distro was made specifically with penetration testing and digital forensics in mind
Penetration testing tools: Metaasploit,Burp Suite, John the Ripper
Digital Forensics tools: Wireshark, tcpdump,Autopsy

Linux
https://nahil.xyz/vault/linux/
AuthorNahil Rasheed
Published atOctober 9, 2025
CopyrightCC BY 4.0
DisclaimerThis content is provided strictly for educational purposes only.