Linux Fundamentals

Git_complex
5 min readJul 24, 2023
Photo by Lukas on Unsplash

Hi Guys, I am starting a new series where I will upload 1 story each day about Linux Fundamentals, So stay tuned to learn the most remarkable OS in the world, At least in my opinion, So without further ado let’s hop into it, shall we?

Today's topic is Linux Structure and a bit of History as well.

So just a little History via some pointers:

  • Linux OS, starting with the Unix operating system released by Ken Thompson and Dennis Ritchie (both worked for AT&T) in 1970.
  • The Berkeley Software Distribution (BSD) was released in 1977, but since it contained the Unix code owned by AT&T, a resulting lawsuit limited development of BSD.
  • Richard Stallman started the GNU project in 1983, His goal was to create a free Unix-like operating system, and part of his work resulted in the creation of the GNU General Public License (GPL).
  • Linux was a personal project started in 1991 by a Finnish student named Linus Torvalds, His goal was to create a new, free operating system kernel.
  • Over the years the Linux kernel has gone from a small number of files written in C under licensing that prohibited commercial distribution to the latest version with over 23 million source code lines, licensed under the GNU General Purpose License v2.

Here are a few more facts about Linux

  • Linux is available in over 600 distributions (OS based on Linux Kernel and supporting software and libraries)
    eg: Ubuntu, Debian, Fedora, OpenSUSE, elementary, Manjara, Gentoo Linux,
    Redhat, and Linux Mint
  • Linux is — more secure than other OS
    - less susceptible to malware than Win OS
    - very frequently updated
    - very stable and generally affords very high performance to the end-user
    - free and open-source

OS: It is software that manages all hardware resources associated with our computer, Meaning OS manages communication between software and hardware

Philosophy

Linux follows 5 core principles

  1. Everything is a file: all config files for the various services running are stored in one or more .txt files
  2. Small, single-purpose programs: tools can be combined to work together
  3. Ability to chain programs together to perform complex tasks: such as processing or filtering specific data results
  4. Avoid captive user interfaces: Linux is designed to work mainly with the shell for greater control
  5. Configuration data stored in a text file: an example of such a file is the /etc/passwd file, which stores all users registered on the system

Compon3nts

  1. Bootloader: a piece of code that runs to guide the booting process. Parrot OS uses the GRUB Bootloader
  2. OS Kernel: The kernel is the main component of an OS. It manages the resources for sys. I/O devices at the hardware level
  3. Daemons: Background services are called “daemons” in Linux. Their purpose is to ensure that critical functions such as scheduling, printing, and multimedia are working properly, these small programs are loaded after we booted or log into the computer
  4. OS Shell: CLI (command language Interpreter) is the interface between the OS and the user. The most commonly used shells are Bash, Tcsh/Csh, Ksh, Zsh, and Fish
  5. Graphics Server: This provides a graphical sub-system called “X-server” that allows graphical programs to run locally or remotely on the X-windowing system
  6. Window Manager: Also called GUI (graphical user interface), Example: GNOME, KDE, MATE, Unity, and Cinnamon. A desktop environment usually has several applications, including file and web browsers. These allow the user to access and manage the essential and frequently accessed features and services of an operating system.
  7. Utilities: Applications or utilities are programs that perform particular functions for the user or another program.

Linux Architecture

The Linux operating system can be broken down into layers:

  1. Hardware: Peripheral devices such as the system’s RAM, hard drive, CPU, and others.
  2. Kernel: The core of the Linux OS whose main function is to virtualize and control common computer hardware resources like CPU, allocated memory, accessed data, and others.
    The kernel gives each process its virtual resources and prevents/mitigates conflicts between different processes.
  3. Shell: A CLI, aka shell that a user can enter commands into to execute the kernel’s functions.
  4. System Utility: Makes available to the users all of the operating system’s functionality.

File System Hierarchy

The Linux structure is structured in a tree-like hierarchy and documented in the Filesystem Hierarchy Standard (FHS)

  1. / : The top-level directory is the root file system and contains all the files required to boot the OS before other filesystems are mounted as well as the files req. to boot the other filesystems.
    After boot, all the other filesystems are mounted at the standard mount point as subdirectories of the root.
  2. /bin : Contains essential command libraries
  3. /boot : Consists of the static bootloader, kernel executable, and files req. to boot the Linux OS
  4. /dev : Contains devices files to facilitate access to every hardware device attached to the system
  5. /etc : Local sys. configuration files. Configuration files for installed applications may be saved here as well.
  6. /home : Each user on the system has a subdirectory here for storage.
  7. /lib : Shared library files that are req. for system boot.
  8. /media : External removable media devices such as USB drives are mounted here.
  9. /mnt : Optional files such as third-party tools can be saved here.
  10. /opt : Optional files such as third-party tools can be saved here.
  11. /root : The home directory for the root user.
  12. /sbin : This directory contains executables used for system administration (binary system files)
  13. /tmp : The OS and many programs use this directory to store temp. files. This directory is generally cleared upon system boot and may be deleted at other times without any warning.
  14. /usr : Contains executables, libraries, man files, etc.
  15. /var : This directory contains variable data files such as log files, email inboxes, web application-related files, cron files, and more.

--

--

Git_complex

Cybersecurity Enthusiast, Bug-bounty hunter, Ethical hacker Exploring new ways to make the Internet a safe place.