# Linux

## Summary


Linux is a kernel used with GNU operating system. It is a Unix-like, open source and community-developed system for computers, servers, mobile devices and embedded devices. It communicates between hardware and software devices of the system and enables all the applications. 

In use cases and applications Linux is similar to other operating systems such as Windows or MacOS. It has word processors, photo editors, video editors and many other applications. It is open source which allows users to view, edit or even contribute to the Linux.

Individuals and companies use it mostly for operating servers as it is more secure and flexible but it is also used in making Android phones, tablets, Chromebooks, digital storage devices, personal video recorders, cameras and many more devices.

## Discussion

### What are components of a Linux system?

Linux operating system comprises different components:

    + **Bootloader**: It is code that manages the boot process of computer. GRUB is the most common boot loader in Linux.
    + **Kernel**: It is the main component of Linux operating system. It manages the CPU, memory, and other peripheral devices. It communicates between a computer's hardware and its processes.
    + **Init System**: It is the first process that run once the kernel is loaded. It acts as the parent process to all other processes running on the system.
    + **Daemons**: These are programs that run in background and handle requests for a service such as printing, sound or scheduling. Httpd daemon is used to listen for web server requests on Linux web servers.
    + **Graphical Server**: It controls how graphics are displayed on the computer screen. Servers and even low-end embedded devices don't need graphical servers or desktop environments.
    + **Desktop Environment**: It is a collection of software and UI controls that users interact with. Each desktop environment comes with built-in applications such as file managers, configuration tools, web browsers, and games.

### What are some basic Linux terms?

Below are some basic terms used in Linux:

    + **Command**: These are printable characters that user type into a program called the ‘command line' to give instructions to the operating system.
    + **Distro**: Linux distribution or distro is a specific version of Linux OS packaged with other components including installation programs, management tools and other software.
    + **Root**: Linux systems have predefined set of rules for users. Different users have different levels of permissions. For instance, a guest user won't be able to modify the OS's main files while a root user (aka *administrator*) has full access to every command and file in the system.
    + **Terminal**: It invokes applications whose execution is scheduled by OS transparent to the user. The UI of terminal is very simple and easy to use.
    + **Shell**: It is Linux command line interpreter. It executes the command given by user.
    + **Device**: There are various special files under the directory `/dev`. These files are called device files. The most common types of device files are block devices and character devices. Character devices communicate by sending and receiving single characters. Block devices communicate by sending blocks of data.

### What are some basic services/utilities provided in Linux?

Below are some basic services/utilities provided in Linux:

    + **User management**: User management activities such as adding user, deleting user, updating or giving certain permissions, creating and removing groups require administrator privileges. Admin permissions can be gained either by changing to the root user with the `su` command or using `sudo`.
    + **File system**: Linux file system has a hierarchal file structure as it contains a root directory and its subdirectories.
    + **Scheduler**: The scheduler also called as process scheduler is the component of the kernel that schedules the processes to run in a systematic manner.
    + **Process management**: Each process starts with a unique five-digit number called process id or PID. We can track the process using this PID.
    + **Package management**: It helps to install, update, remove, and keep track of software updates in the Linux system.
    + **Memory management**: Linux memory management subsystem manages the implementation of virtual memory and demand paging, memory allocation both for kernel internal structures and user space programs, mapping of files into processes address space and many other things.

### How does Linux differ from other operating systems?

The Linux is totally free of cost whereas Windows is a costly OS. Unlike in Windows, users can access the source code of Linux as it is open source. Linux is more secure compared to Windows and MacOs. File names are case sensitive in Linux which is not the case in Windows. Linux uses the monolithic kernel while Windows utilizes the micro-kernel. Linux is more efficient than Windows in performing operations while Windows has a better user friendly UI and navigation. Hackers use Linux based systems as Windows is not a very efficient OS for hacking purposes. 


### Which industries use Linux?

Linux is the core of many industries while Windows OS dominates in market share. Linux is the most favourite operating system of Microsoft Azure's customers. It is used to develop several coding languages and build embedded systems. Microsoft's operating system named Azure Sphere is also built on Linux kernel. 

There are broadly two types of categories that use Linux:

    + **Consumer devices**: Google's video streaming platform Chromecast also runs on Linux. Panasonic, Samsung, Phillips and many more use Linux-based operating systems for their devices. Lightweight laptops such as Chromebook use Chrome OS, which is built on Linux. Instagram, Facebook, YouTube and Twitter all run on Linux.
    + **Non-consumer devices**: In US, The Library of Congress, House of Representatives, Senate, and White House all use Linux. The New York Stock Exchange uses Linux. The Indian state Kerala has made Linux mandatory for all the high schools computers. NASA's Pleiades supercomputer runs on Linux. The International Space Station switched from Windows to Linux in 2013 due to its reliability. Linux is the leading operating system used for servers.

### How can I get started using Linux?

The prerequisites for learning Linux includes basic computer skills and a basic computer system with single-core CPU, 128 MB of memory and few GBs of hard disk. 

First step is to decide the Linux distro version to use. There are many beginner friendly and free-to-use Linux distros such as Ubuntu, Debian GNU, openSUSE and CentOS. Each of them has its own advantages and features. After selection, one needs to install the Linux distro on the system. 

In the learning phase users have a lot of problems and challenges which they can tackle using communities such as StackOverflow and GitHub as they are helping open-source communities. Below are some courses and cheatsheets to learn Linux command line: 

    + Learn The Linux Command Line: Basic Commands
    + Linux Tutorials and Projects
    + Learn Linux on a MAC
    + Linux Commands Cheat Sheet by Linux training academy
    + Linux Command Line Cheat Sheet by DaveChild
    + Linux Command Line by Das
    + Books: *The Linux Command Line: A Complete Introduction* by William Shotts and *How Linux Works* by Brian Ward are two books for beginners.

### What are the pros and cons of using Linux?

As it has a small user base compared to other OS, hackers avoid targeting it. Every Linux distribution is tested many times against bugs before releasing a stable version which makes it a stable option. Linux is released under the GNU GPL license which makes it free to use. Unlike Windows and MacOS, users are free to customize Linux distributions according to their needs. Linux systems can run on even 500 MB ram or at 256 MB RAM, as it uses resources very efficiently. Users can install software using a few commands on terminal. 

However, Linux has some disadvantages. It is less user-friendly compared to Windows and MacOS. Troubleshooting in Linux is difficult for beginners. It is not a preferred option for games. There are no drivers in Linux which can be a significant issue at times. 

## Milestones

Sep  
1991

Linus Torvalds releases **Linux kernel**. 

1992

Orest Zborowski ports the X Window System to Linux. As a result Linux starts gaining more importance and user base. It allows Linux to support **Graphical User Interface (GUI)**. Linux Kernel is released under GPL licence. 

1993

**Slackware** Linux version 1.0 is released. Even 25 later, it remains the oldest Linux distribution that's actively maintained. 

1994

**Linux 1.0.0** is released with 176,250 lines of code. In June 1996, Torvalds releases Linux version 2.0.0. that contains 41 releases. Support for symmetric multiprocessing (SMP) and support for more types of processors are added in this version. On 04 January 2001, Linux version 2.4.0 is released. It consists support for ISA Plug and Play, USB, and PC Cards. On 17 December 2003, Linux version 2.6.0 is released. Support for files of other OS such as JFS, XFS, Solaris, Windows and MS-DOS is added. Torvalds releases Linux version 3.0 on 22 July 2011. 

1996

A project for desktop Linux called as **KDE** is announced. A year later, an alternative desktop environment called **GNOME** is announced. It's supposed to provide free and complete set of user friendly applications and desktop tools. In 1999, GNOME 1.0 is released at Linux Expo. 

2003

An attempt is made to insert a backdoor in the Linux kernel source. The backdoor is designed to obtain root privileges under specific conditions. Linux Kernel maintainers acknowledge it before it could access Linux kernel and do any harm. 

2005

The free version control system used for the Linux Kernel development called BitKeeper becomes paid. Linus Torvalds decides to work on his own version control system and creates **Git**. 

2008

A mobile operating system based on Linux Kernel called as **Android** is released. Android would go on to become the leading OS in the world of mobile operating systems. 

2011

Microsoft which was at war with Linux now partners with LinuxTag for their event. In 2012, Microsoft sponsors LinuxTag event. It also starts hosting Linux virtual machines in the Azure cloud computing service.