Basics Of Linux.

Basics Of Linux.

#Day2 #90DaysOfDevOps

Table of contents

No heading

No headings in the article.

What is Linux:

Linux is a free and open-source operating system that is based on Unix. It was first developed by Linus Torvalds in 1991 and has since grown to become one of the most popular operating systems in use today, especially in the field of servers and supercomputers.

In simple words, Linux is like the engine that runs your computer. It manages the hardware resources of your computer and allows you to run other software applications on top of it. It is highly customizable and flexible, allowing users to modify and adapt it to suit their needs. Additionally, Linux is known for its security, stability, and reliability.

Linux is different from other operating systems like Windows and macOS in that it is open-source, meaning that its source code is available to the public and can be modified and distributed freely. This has led to a large and dedicated community of developers who contribute to the development and improvement of the Linux operating system.

Linux is highly customizable and flexible, allowing users to modify and adapt it to suit their needs. Additionally, Linux is known for its security, stability, and reliability, making it a popular choice for use in critical systems such as servers and supercomputers.

Evolution Of Linux:

Linux has a rich history of development and evolution over the years. Here is a brief overview of the major milestones in the evolution of Linux:

  1. In 1991, Linus Torvalds, a Finnish student, developed the first version of Linux, which was based on the MINIX operating system.

  2. In 1992, the first official version of Linux was released, which was version 0.12.

  3. Throughout the 1990s, Linux gained popularity among developers and computer enthusiasts due to its open-source nature and flexibility.

  4. In the late 1990s and early 2000s, Linux began to gain traction in the enterprise market as more companies began to adopt it for their server and workstation environments.

  5. In 2003, the first version of the Linux kernel with support for 64-bit processors was released.

  6. In 2005, the first version of the Linux kernel with support for the PowerPC architecture was released.

  7. In 2007, the first version of the Linux kernel with support for the Cell processor was released.

  8. In the late 2000s and early 2010s, Linux became increasingly popular in the mobile device market, with the development of the Android operating system.

In recent years, Linux has continued to evolve and improve, with new features and optimizations being added to the kernel on a regular basis.

Flavours Of Linux:

There are many different flavors, or distributions, of Linux available, each with its own unique set of features, applications, and user interfaces. Here are some of the most popular Linux distributions:

  1. Ubuntu: Ubuntu is one of the most popular Linux distributions and is known for its user-friendly interface and ease of use. It is based on Debian and is available in both desktop and server editions.

  2. Debian: Debian is a stable and reliable Linux distribution that is known for its focus on open-source software and strong community support. It is available in both desktop and server editions.

  3. Fedora: Fedora is a community-driven Linux distribution that is known for its cutting-edge software and focus on innovation. It is available in both desktop and server editions.

  4. CentOS: CentOS is a free and open-source Linux distribution that is based on Red Hat Enterprise Linux. It is known for its stability, security, and reliability, and is often used in server environments.

  5. Arch Linux: Arch Linux is a lightweight and customizable Linux distribution that is known for its simplicity and minimalism. It is often used by advanced users who prefer to build their own systems from the ground up.

  6. Linux Mint: Linux Mint is a user-friendly Linux distribution that is based on Ubuntu and is designed to be easy to use for beginners. It is known for its clean and polished user interface.

How Linux Works?

Linux works by interacting with the computer's hardware to perform various tasks, such as running applications, managing files and directories, and communicating over networks. Here is a brief overview of how Linux works:

  1. Boot Process: When a computer is turned on, the BIOS (Basic Input/Output System) initializes the hardware and loads the boot loader. The boot loader then loads the Linux kernel into memory and initializes the operating system.

  2. Kernel: The Linux kernel is responsible for managing the hardware resources of the computer, including the CPU, memory, input/output devices, and network interfaces. The kernel also provides system calls that allow applications to interact with the hardware.

  3. Shell: The shell is a command-line interface that allows users to interact with the operating system. The shell provides a way for users to enter commands and execute programs.

  4. User-space Applications: User-space applications are programs that run on top of the operating system. These applications include graphical user interfaces, web browsers, office suites, media players, and development tools.

  5. System Tools: Linux comes with a variety of system tools that help users manage the system. These tools include utilities for managing files and directories, monitoring system performance, configuring network settings, and installing software.

  6. File System: The Linux file system is a hierarchical structure that organizes files and directories. It uses a tree-like structure, with the root directory (/) at the top and subdirectories branching off from there.

  7. Networking: Linux supports a wide range of networking protocols, allowing users to communicate over local networks and the Internet. Linux can act as a client or server for various network services, such as web servers, email servers, and file servers.

Architecture Of Linux:

The architecture of Linux can be divided into three main components: the kernel, system libraries, and user-space programs.

  1. Kernel: The Linux kernel is the core of the operating system. It manages the system's hardware resources, provides system calls to user-space programs, and handles input/output (I/O) operations. The kernel also includes device drivers, which allow the operating system to communicate with hardware devices such as hard drives, network cards, and printers.

  2. System Libraries: System libraries are collections of pre-written code that can be used by applications to perform common tasks, such as reading and writing files, connecting to a network, and manipulating data. The most important system library in Linux is the GNU C Library (glibc), which provides a standard set of functions and interfaces that can be used by all applications.

  3. User-Space Programs: User-space programs are applications that run on top of the kernel and use the system libraries to interact with the operating system and perform various tasks. These can include command-line utilities, graphical user interface (GUI) applications, and servers that provide network services such as web hosting or email.

Linux File System Hierarchy:

The Linux File System Hierarchy is a standard way of organizing files and directories in Linux operating systems. It defines the main directories in the file system and their purposes.

The root directory "/" is the starting point and all other directories and files are located under it.

Here is an overview of the key directories in the Linux file system hierarchy:

/: The root directory of the file system. All other directories and files are located under this directory.

/bin: Essential command binaries used by the system administrator and users. These binaries are required for system booting and maintenance.

/boot: Contains the boot loader files, kernel, and initial RAM disk.

/dev: Contains device files that represent hardware devices attached to the system.

/etc: Contains system-wide configuration files and scripts.

/home: Contains home directories for regular users.

/lib: Contains shared libraries required by the system and other binaries in /bin, /sbin, and /usr/bin.

/media: Mount point for removable media devices such as CDs, DVDs, and USB drives.

/mnt: Temporary mount point for mounting file systems.

/opt: Contains optional software packages.

/proc: Contains information about system processes and kernel information.

/root: Home directory for the system administrator (root).

/run: Contains information about the running system since the last boot.

/sbin: Essential system binaries used for system maintenance tasks.

/srv: Contains data for services provided by the system.

/sys: Contains information about devices, drivers, and other kernel modules.

/tmp: Contains temporary files created by applications and the system.

/usr: Contains read-only user data and application files.

/var: Contains variable data files, including logs, spool files, and temporary files.

Difference between Linux and Windows:

Linux

Windows

Open-source and free

Proprietary and requires a license fee

Frequent updates and customization

Infrequent updates and less customizable

Multiple GUI options available

Consistent interface across all versions

More secure and stable

More prone to malware and viruses

Larger selection of open-source and free software

Larger selection of commercial software

Better suited for programming and development

Better suited for gaming and multimedia

Fewer hardware compatibility issues

Better support for hardware devices

More efficient use of system resources

Less efficient use of system resources

Command-line driven

GUI-driven with command-line options

Basic Linux Commands:

  1. Pwd: Prints the current working directory.

  2. ls:Lists the files and directories in the current working directory.

  3. cd: Changes the current working directory

  4. cp: Copies a file.

  5. mkdir: creates a new directory.

  6. rmdir: Removes a directory.

  7. touch: Creates a new file.

  8. mv: Renames or moves a file.

  9. rm: Deletes a file

  10. cat: Displays the contents of a file.

  11. head: Displays the first few lines of a file.

  12. tail: Displays the last few lines of a file.

  13. grep: Searches for a specific string in a file.

  14. chmod: Changes the permissions of a file or directory.

  15. sudo: Executes a command with administrative privileges.