Linux Command Line - Overview

Linux kernelGNU utilitiesThe Linux Desktop EnvironmentLinux Application software

What Is Linux?

Linux is an open-source operating system that was created by Linus Torvalds in 1991. It is based on the Unix operating system and is widely used in supercomputers, servers, mobile devices, and embedded devices.

Linux is highly customizable, which allows users to customize and configure the operating system to suit their specific needs. Linux provides stability, security, and reliability on a wide range of hardware architecture.

Linux comes in many different distributions, features, and package management systems but all share a common kernel and software. Linux mainly contains the following four parts,

  • The Linux kernel
  • The GNU utilities
  • The Linux Desktop Environment
  • Application software

Figure 1-1 shows the overall Linux system diagram.

linux-system-diagram

Linux Kernel

Linux kernel is the core of the Linux system, Linux kernel is a free open-source UNIX-like operating system. The following are the primary responsibilities of the kernel,

  1. Software program Management
  2. System Memory Management
  3. Filesystem Management
  4. Hardware Management

Software program Managementmanages all processes running on the system. The process is the running instance of the program. Generally, Linux systems have two types of processes: foreground process and background process. The foreground process depends on user input, and the background process is an automatic process like network manager, or display manager. Linux kernel's first process is the init process, a parent process of all other processes. Init process is located in /sbin/init or /etc/init or /bin/init.

The init process looks for the default run level of the system. With the help of a run level, individual applications can be started at boot time. The path of the boot time application differs in different Linux distributions, the general location is /etc/inittabs or /etc/init.d folder.

System Memory Management manages physical and virtual memory. When a system requires more physical memory, in that case, the memory manager creates and manages virtual memory from the hard disc. Using hard disc space is called swap space.

A bunch of memory chunks of virtual and physical memory are called pages. Generally, pages are 8 Kbyte or 4 Kbyte in size. The kernel maintains tables to locate pages in physical and swapped spaces.

Filesystem Management, System stores data in a memory partition, to quickly access each memory partition, the system creates a partition or data structure. Systems use the data structure to read and write data. It's called a file system. Linux Kernel can be compiled with all types of filesystems.

Following is a list of filesystems,

TypeDescription
extLinux Extended filesystem — the original Linux filesystem
ext2Second extended filesystem, provided advanced features over ext
ext3Third extended filesystem, supports journaling
ext4Fourth extended filesystem, supports advanced journaling
nfsNetwork File System
ntfsSupport for Microsoft NT filesystem

Hardware Management, To communicate hardware devices attached to the system, Linux uses device drivers. The device driver enables the kernel to interact with a hardware device by reading and writing data to it. Drivers are communicating between applications and the hardware.

For each hardware device, Linux creates special files, called nodes. The device node is used for all communication between devices.

Linux system supports three types of the device driver,

  1. Character Device Driver - handles one character at a time.
  2. Block Device Driver - handles large data blocks at a time.
  3. Network Device Driver - handles network packets.

We'll discuss more details in an upcoming blog.


GNU Utilities

Linux kernel requires utilities to perform some other functions like user applications, network programs, etc. These utilities are developed by the GNU(GNU’s Not Unix) organization. The GNU develops utilities under an open-source software(OSS) that allows it to use software with no licensing fees.

Following are some GNU Utilities:

NoNameDescription
1.lsIt's a File utility to use to list the files in a directory
2.mvIt's a File utility to use change file location
3.mkdirIt's a File utility to use to create a directory
4.echoIt's a sell utility to use display text on console/terminal
5.dateIt's a sell utility to use display date on console/terminal

GNU Utilities established a Unix-like environment system. The set of essential utilities within GNU, known as the coreutils package, forms the foundation of this system.

The Shell, GNU/Linux shell is a unique interactive utility, serving as a command-line interpreter for the operating system's services. The heart of the shell is the command prompt. The Terminal or Command(Terminal) prompt allows the user to execute shell commands. A group of shell commands is called shell scripts. GNU provides a bash shell as a replacement for the standard UNIX shell.


Linux Desktop Environment

Similar to Microsoft Desktop. Linux provides an adequate number of graphical desktops distribution. Let's discuss some of the distributions,

X Window System, Is a low-level program that works with video and display of the system. X Window configured/supported with many video cards and displays. It provides a graphical display environment, a stand-alone application can run but it's not useful for general purpose systems.

The K Desktop Environment (KDE), KDE is a popular graphical desktop environment system like Microsoft Windows environments. This environment provides a menu bar, shortcuts, a taskbar, and many more.

The GNOME Desktop, GNOME stands for NU Network Object Model Environment, Its default desktop environment of many Linux distributions.

The Unity Desktop, aims to offer a unified user experience across workstations, tablets, and mobile devices, providing a seamless and consistent interface for users across various platforms.


Application software

Linux's core layer enables a wide range of application software across various categories. The availability of these applications can vary depending on the specific Linux distribution you're using. Here are some examples:

Web Browsers, Linux supports different web browsers, providing users with options based on their preferences for speed, features, and privacy. For example Google Chrome and Mozilla Firefox etc.

Media Players, Linux supports a versatile and open-source media player that supports a wide range of audio and video formats. Like VLC.

Document Viewers, Linux offers various document viewers for viewing and interacting with different document types. For example GEdit, Adobe Acrobat Reader, xPDF etc.


Summary

In summary, we've learned about the basic building blocks of the Linux operating system, like its core system and important tools called GNU utilities. Understanding these basics helps us see how Linux is put together, preparing us for the adventure of learning Linux shell scripting.