Linux Bootcamp

Part 1

Fundamental and essential skills for a DevOps Engineer
Let us start the journey of Linux

Why Linux?
Here are some other factors that make Linux a favorable option compared to other operating systems:

  • Open source philosophy
The ability to access, modify, and distribute the source code empowers users to tailor the operating system to their specific needs.

  • Cost
Linux is generally free to use, making it an economical choice for individuals, businesses, and organizations.

  • Variety of Distributions
Linux embodies open source ideals, fostering collaboration, transparency, and customization. Access to and modification of the source code empower users to shape the OS to their needs.

Because of its adaptability and open nature, Linux is utilized across diverse domains, including personal computing, servers, mobile devices (Android), embedded systems, scientific research, and more.

What is Linux ?
Linux is a Unix-like operating system.
So here, first we need to understand two terms, “Unix-like” and “Operating system”.
UNIX
UNIX is a family of multi-tasking, multi-user computer operating systems that originated in the 1960s. Many modern operating systems, including Linux and macOS, were heavily influenced by the design principles and concepts of UNIX. While the original UNIX operating system is no longer widely used, its ideas and concepts continue to shape the world of computing.

Key characteristics of UNIX include:
  • Multiuser and Multitasking: UNIX allows multiple users to access and use the system simultaneously. Each user has their own account and can run multiple processes (programs) at the same time.

  • Hierarchical File System: UNIX uses a hierarchical file system where files and directories are organized in a tree-like structure, with a root directory ("/") at the top.

  • Command-Line Interface: UNIX systems use a command-line interface (CLI) where users interact with the system by typing commands. These commands perform various tasks, such as managing files, executing programs, and configuring the system.

  • Shell: The shell is a command-line interpreter that reads user input, interprets commands, and communicates with the operating system to execute those commands.

  • Portability: One of the key goals of UNIX was to be portable across different hardware architectures. This allowed software to be written once and run on various UNIX systems without major modifications.

  • Modularity and Reusability: UNIX is built around the concept of small, single-purpose programs that can be combined to perform complex tasks. This modularity promotes code reusability and system flexibility.

  • Networking and Communication: UNIX systems were among the first to support networking and inter-process communication, allowing processes on different machines to communicate over a network.

  • Security and Permissions: UNIX systems implement strong security measures, such as user accounts, passwords, and file permissions, to protect data and resources from unauthorized access.

  • Standards and Interoperability: UNIX adheres to various standards, making it compatible with a wide range of software and hardware components.

OPERATING SYSTEM
An operating system (OS) is a software program that acts as an intermediary between computer hardware and software applications.
The kernel is the heart of the operating system. It interacts directly with the hardware and manages resources like memory, processors, and devices. And it provides essential services, such as process management, memory management, device drivers etc.
Returning to the topic at hand, Linux is a Unix-like, open source operating system that offers a powerful platform for users to interact with their hardware and run applications efficiently.
How does it work ?
The following illustration shows the architecture of a Linux OS:

Hardware Layer: This is where all the hardware devices like RAM, HDD, and CPU are located.


Kernel: Like any other operating system, Linux too has a kernel that talks directly to the hardware and provides essential services to other parts.


Shell: The shell is like a translator between you and the kernel. It takes your commands and makes them understandable to the kernel.
Utilities: These are helpful tools that let you do many things with the operating system. They make using the computer easier and more efficient.

EXAMPLE #1
Let's use a simple example of creating a new directory to understand the functioning of these Linux components:

User Action: The user enters the command "mkdir new_directory" in the shell and presses Enter.

Shell Interaction: The shell interprets the command and understands that the user wants to create a new directory named "new_directory".
It communicates with the kernel, requesting the creation of a new directory called "new_directory".

Kernel Action: The kernel receives the request and checks permissions to ensure the user has the necessary rights to create a directory. If permissions are correct, the kernel creates the directory and updates the file system accordingly.

And it notifies the shell that the directory has been created. The shell displays a confirmation message to the user.

EXAMPLE #2
Let's consider another example of a user launching a web browser (chrome browser):
User Action: The user clicks on the web browser icon to launch it.

Shell Interaction: The shell (command interpreter) takes the user's command and communicates with the kernel. In this case, the shell recognizes the command to launch the web browser
.
Kernel Action: The kernel allocates memory for the browser's process, schedules it to run on a processor core, and sets up the necessary resources for the browser to execute.

The chrome web browser process is now running. It communicates with the kernel to interact with hardware devices like the display, mouse, and keyboard. The kernel manages these interactions, ensuring the browser has access to the resources it needs.

Conclusion
This theoretical overview has provided us with foundational knowledge about the Linux operating system. Now, let's delve deeper into its practical applications in the upcoming sections.