Skip to main content

Linux Structure

 Linux Structure


History

Linux, computer operating system created in the early 1990s by Finnish software engineer Linus Torvalds and the Free Software Foundation (FSF). While still a student at the University of Helsinki, Torvalds started developing Linux to create a system similar to MINIX, a UNIX operating system. 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 (comments excluded), licensed under the GNU General Public License v2.

Linux is available in over 600 distributions (or an operating system based on the Linux kernel and supporting software and libraries). Some of the most popular and well-known being Ubuntu, Debian, Fedora, OpenSUSE, elementary, Manjaro, Gentoo Linux, RedHat, and Linux Mint.

Linux is generally considered more secure than other operating systems, and while it has had many kernel vulnerabilities in the past, it is becoming less and less frequent. It is less susceptible to malware than Windows operating systems and is very frequently updated. Linux is also very stable and generally affords very high performance to the end-user. However, it can be more difficult for beginners and does not have as many hardware drivers as Windows.

Since Linux is free and open-source, the source code can be modified and distributed commercially or non-commercially by anyone. Linux-based operating systems run on servers, mainframes, desktops, embedded systems such as routers, televisions, video game consoles, and more. The overall Android operating system that runs on smartphones and tablets is based on the Linux kernel, and because of this, Linux is the most widely installed operating system.

Linux is an operating system like Windows, iOS, Android, or macOS. An OS is software that manages all of the hardware resources associated with our computer. That means that an OS manages the whole communication between software and hardware. Also, there exist many different distributions (distro). It is like a version of Windows operating systems.

Today, supercomputers, smart phones, desktop, web servers, tablet, laptops and home appliances like washing machines, DVD players, routers, modems, cars, refrigerators, etc use Linux OS.

Philosophy

Linux follows five core principles:

PrincipleDescription

Everything is a file

All configuration files for the various services running on the Linux operating system are stored in one or more text files.

Small, single-purpose programs

Linux offers many different tools that we will work with, which can be combined to work together.

Ability to chain programs together to perform complex tasks

The integration and combination of different tools enable us to carry out many large and complex tasks, such as processing or filtering specific data results.

Avoid captive user interfaces

Linux is designed to work mainly with the shell (or terminal), which gives the user greater control over the operating system.

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.


Components

Component

Description

Bootloader

A piece of code that runs to guide the booting process to start the operating system. Parrot Linux uses the GRUB Bootloader.

OS Kernel

The kernel is the main component of an operating system. It manages the resources for I/O devices the system at the hardware level.

Daemons

Background services are called "daemons" in Linux. Their purpose is to ensure that key functions such as scheduling, printing, and multimedia are working correctly. These small programs load after we booted or log into the computer.

OS Shell

The operating system shell or the command language interpreter (also known as the command line) is the interface between the OS and the user. This interface allows the user to tell the OS what to do. The most commonly used shells are Bash, Tcsh/Csh, Ksh, Zsh, and Fish.

Graphics server

This provides a graphical sub-system (server) called "X" or "X-server" that allows graphical programs to run locally or remotely on the X-windowing system.

Window Manager

Also known as a graphical user interface (GUI). There are many options, including 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.

Utilities

Applications or utilities are programs that perform particular functions for the user or another program.


Linux Architecture

Component

Description

Bootloader

A piece of code that runs to guide the booting process to start the operating system. Parrot Linux uses the GRUB Bootloader.

OS Kernel

The kernel is the main component of an operating system. It manages the resources for I/O devices the system at the hardware level.

Daemons

Background services are called "daemons" in Linux. Their purpose is to ensure that key functions such as scheduling, printing, and multimedia are working correctly. These small programs load after we booted or log into the computer.

OS Shell

The operating system shell or the command language interpreter (also known as the command line) is the interface between the OS and the user. This interface allows the user to tell the OS what to do. The most commonly used shells are Bash, Tcsh/Csh, Ksh, Zsh, and Fish.

Graphics server

This provides a graphical sub-system (server) called "X" or "X-server" that allows graphical programs to run locally or remotely on the X-windowing system.

Window Manager

Also known as a graphical user interface (GUI). There are many options, including 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.

Utilities

Applications or utilities are programs that perform particular functions for the user or another program.


File System Hierarchy

The Linux operating system is structured in a tree-like hierarchy and is documented in the Filesystem Hierarchy Standard (FHS). Linux is structured with the following standard top-level directories:

iamge

Filesystem hierarchy standard describes directory structure and its content in Unix and Unix like operating system. It explains where files and directories should be located and what it should contain.
Its current version is 3.0 released on June 3rd 2015 and is maintained by Free Standards Group. In Unix like operating system everything is considered as a file.
Only Linux distributions follow the FHS and that too partially. Because every distro have their own policy due to which you may notice some differences in the directory tree structure of different distros.
If you want to find out information about your system's FHS, enter the command man hier. It will display directory structure of your system.

Path

Description

/

The top-level directory is the root filesystem and contains all of the files required to boot the operating system before other filesystems are mounted as well as the files required to boot the other filesystems. After boot, all of the other filesystems are mounted at standard mount points as subdirectories of the root.

/bin

Contains essential command binaries.

/boot

Consists of the static bootloader, kernel executable, and files required to boot the Linux OS.

/dev

Contains device files to facilitate access to every hardware device attached to the system.

/etc

Local system configuration files. Configuration files for installed applications may be saved here as well.

/home

Each user on the system has a subdirectory here for storage.

/lib

Shared library files that are required for system boot.

/media

External removable media devices such as USB drives are mounted here.

/mnt

Temporary mount point for regular filesystems.

/opt

Optional files such as third-party tools can be saved here.

/root

The home directory for the root user.

/sbin

This directory contains executables used for system administration (binary system files).

/tmp

The operating system and many programs use this directory to store temporary files. This directory is generally cleared upon system boot and may be deleted at other times without any warning.

/usr

Contains executables, libraries, man files, etc.

/var

This directory contains variable data files such as log files, email in-boxes, web application related files, cron files, and more.




Comments

Popular posts from this blog

Python OOPs Concepts: Using Variables and Methods

  Types of Variables in OOPs Python   Instance Variable Static Variable Local Variable   Object Level Variables Class Level Variables Method Level Variables When to use: For Every Object if you want Separate copy, use Instance Variables For all object one copy is required, use static variables Inside method, Just used for temporary requirement Where to Declare Inside the constructor method (in general) Within the class directly, outside of methods (in general)   Within the method only. How to Declare Within the constructor: Instance variables can be declared within the constructor method using the self .   Using default values : Instance variables can be assigned default values during initialization.   Outside the class: use object name.   ·          Within the class directly

Inheritance

Inheritance is a fundamental concept in object-oriented programming, which allows a class to inherit properties and methods from another class. There are several types of inheritance, including: Single Inheritance: In single inheritance, a subclass inherits properties and methods from a single parent class. The subclass is said to be derived from the parent class. Multiple Inheritance: Multiple inheritance allows a subclass to inherit properties and methods from multiple parent classes. In this case, the subclass is said to have multiple base classes. However, multiple inheritance can lead to complexity and ambiguity in the code. Multilevel Inheritance: Multilevel inheritance occurs when a subclass inherits properties and methods from a parent class, which in turn inherits from another parent class. In this case, the subclass is said to be derived from both the parent class and the grandparent class. Hierarchical Inheritance: Hierarchical inheritance occurs when multiple subclasses

Polymorphism: Method Overloading vs Method Overriding

  Method Overloading In object-oriented programming languages, method overloading enables a class to have several methods with the same name but different parameters. However, in Python, method overloading is not directly supported as opposed to languages such as Java or C++. This is because Python allows developers to define default arguments for their methods and pass arguments of any type to a method. This flexibility allows a single method to handle various types of arguments, eliminating the need for overloading.   However, there is a way to simulate method overloading in Python by using default argument values or variable length arguments and conditional statements. Here's an example: Program using default arguments:       Program using variable length arguments:   Multiple methods with Same Name: When we define multiple methods with same name, Python will consider the last defined method only. Python will not support method overloading. ( Why? Method overlo