Monday, 22 February 2021

Linux Licensing

 Linus Torvalds has given linux kernel license to GNU General Public License (GPL) version 2. GNU make sure that any software source code licensed under it have to make originating source code open and freely availble to all its users. Here, freely doesn't mean by cost but it means that it is freely available to users to distribute and modify the code.

There is the third version of GNU, GNU Lesser General Public License (LGPL) version 3. But it imposes some more permissions on the license. Torvalds doesn't like some provisions in version 3 and have announced that linux kernel will not come under version 3.

Linux Distributions (Distros)

 Other operating systems like Microsoft combine each bit of codes internally and release it as a single package. You have to choose from one of the version they offer.

But Linux is different from them. Different parts of Linux are developed by different organizations.

Different parts include kernel, shell utilities, X server, system environment, graphical programs, etc. If you want you can access the codes of all these parts and assemble them yourself. But its not an easy task seeking a lot of time and all the parts has to be assembled correctly in order to work properly.

From here on distribution (also called as distros) comes into the picture. They assemble all these parts for us and give us a compiled operating system of Linux to install and use.


Linux Distributions List

There are on an average six hundred Linux distributors providing different features. Here, we'll discuss about some of the popular Linux distros today.

1) Ubuntu

It came into existence in 2004 by Canonical and quickly became popular. Canonical wants Ubuntu to be used as easy graphical Linux desktop without the use of command line. It is the most well known Linux distribution. Ubuntu is a next version of Debian and easy to use for newbies. It comes with a lots of pre-installed apps and easy to use repositories libraries.

Earlier, Ubuntu uses GNOME2 desktop environment but now it has developed its own unity desktop environment. It releases every six months and currently working to expand to run on tablets and smartphones.

2) Linux Mint

Mint is based on Ubuntu and uses its repository software so some packages are common in both.

Earlier it was an alternative of Ubuntu because media codecs and proprietary software are included in mint but was absent in Ubuntu. But now it has its own popularity and it uses cinnamon and mate desktop instead of Ubuntu's unity desktop environment.

3) Debian

Debian has its existence since 1993 and releases its versions much slowly then Ubuntu and mint.

This makes it one of the most stable Linux distributor.

Ubuntu is based on Debian and was founded to improve the core bits of Debian more quickly and make it more user friendly. Every release name of Debian is based on the name of the movie Toy Story.

4) Red Hat Enterprise / CentOS

Red hat is a commercial Linux distributor. There products are red hat enterprise Linux (RHEL) and Fedora which are freely available. RHEL is well tested before release and supported till seven years after the release, whereas, fedora provides faster update and without any support.

Red hat uses trademark law to prevent their software from being redistributed. CentOS is a community project that uses red hat enterprise Linux code but removes all its trademark and make it freely available. In other words, it is a free version of RHEL and provide a stable platform for a long time.

5) Fedora

It is a project that mainly focuses on free software and provides latest version of software. It doesn't make its own desktop environment but used 'upstream' software. By default it has GNOME3 desktop environment. It is less stable but provides the latest stuff.


Choosing a Linux Distro

DistributionWhy To Use
UBuntuIt works like Mac OS and easy to use.
Linux mintIt works like windows and should be use by new comers.
DebianIt provides stability but not recommended to a new user.
FedoraIf you want to use red hat and latest software.
Red hat enterpriseTo be used commercially.
CentOSIf you want to use red hat but without its trademark.
OpenSUSEIt works same as Fedora but slightly older and more stable.
Arch LinuxIt is not for the beginners because every package has to be installed by yourself.

Linux vs Windows

Linux vs. Windows has always been one of the most frequently asked questions related to the operating system. Users often get confused about which one is better for them. There is diversity between the users as most users prefer the graphical user interface (GUI) and most command-line interface (CLI). There are many disagreements and acrimonious behavior among users, and it seems that it will be forever.

Linux vs. Windows

In this section, we will discuss the differences between Linux and Windows by considering several parameters such as performance, usability, security, ease of use, and more to clear a picture of using both operating systems. Further, we will see the advantages of Linux over other operating systems such as Windows and Mac OS. This will help you to decide which one is better for you.

Difference between Linux and Windows operating system

To understand the difference between Linux and Windows, let's see a brief introduction to both operating systems. Later we will talk on their features and security options.

What is the Windows operating system?

Windows is a graphical operating system developed and marketed by Microsoft. It is also referred to as Microsoft Windows. Several versions of Windows have been introduced in the market; the current version is Windows 10. The first version of Windows was introduced on November 20, 1985, as a graphical operating system for MS-DOS.

Microsoft Windows is a family of various operating systems. It comes with two versions, i.e., 64 bit and 32 bit. It facilitates both client and server versions. The latest client version is Windows 10, and the server version is Windows server 2019.

Windows is a straight forward and simple to use. Generally, it is designed for users having no programming knowledge. So, mostly it is used for business and alternative industrial purposes.

What is a Linux operating system

Linux is an open-source operating system. As it is open-source, it is special and different from other operating systems, which means that you can customize it by editing source code. It provides programming as well as a graphical user interface. Linux is built by Linux Torvalds because he wanted to create a free operating system kernel that anyone can use.

Linux is a collection of operating systems that are based on Linux kernel. The first version of Linux was released in the year 1991. The Linux system is most commonly used for servers; however, it is available in desktop versions as well.

Ubuntu, Devian, and Fedora are some popular Linux distributions. Also, we have SUSE Linux Enterprise Server (SLES) and RedHat Enterprise Linux for the commercial distribution of Linux. As it is open-source, we can modify the source code and make variations in the operating system.

Let's discuss some features and parameters to understand the difference between both operating systems:

  • File System

Linux vs. Windows

Windows uses different drives such as C, D, E, and more, having some folders to store files.

But Linux uses a tree structure to store and organize files. Linux file structure starts from the root directory, and it is considered as a start point of the file system. It is represented by a forward slash (/). In Linux, everything (Directories, devices, and files) is considered a file.

There are three types of files available in a Linux system.

  • General files
  • Directory files
  • Device files

The general file system of Unix is as follows:

Linux vs. Windows

General files: General files or ordinary files are files that contain images, text, or a program. These files are in ASCII text or Binary format. The General files are the most common in any Linux system.

Directory files: Directory files are the depository for other files. A directory can have a subdirectory file within it. For Windows, we can understand them as folders.

Device files: Windows represents the external devices (Pendrives, hard drives, and CD-ROM) as letters such as E: F: But, Linux represents devices as files, such as the hard drive's partitions are represented as dev/sda1, dev/sda2, and more (depends upon the number of partitions). All the device files take place within the directory /dev.

  • Naming Conventions for file

Linux files are case sensitive; therefore, we can have two files having the same name; one in upper case and other in lower case. Comparatively, the Windows files are not case sensitive; we cannot have two files with the same name.

  • Users

Windows supports four types of users:

  • Administrator
  • Standard
  • Child
  • Guest

Comparatively, Linux supports three types of users:

  • Regular
  • Administrative(root)
  • Service

Regular User

In Linux, when we install ubuntu on our system, a regular account user is created. By default, all our files are saved in the home directory (/home/). A regular user cannot access the other user's directories.

Root User

Apart from the regular user account, a root user account is also created during installation. The root account is also called as superuser as it can access the restricted files, install the software and other utility, and has administrative rights. For installing the software or editing the system files or any other administrative task, we need the root access. For general tasks such as creating files, playing games, browsing the internet, we don't need the root access.

Service user

The Linux system is widely used as the server operating system. The leading service providers such as Apache, Squid, email, and more have their service accounts to increase security. Linux service user can allow or deny access to various resources depending on the service type.

Note: The Ubuntu Desktop version does not have a service account, and the regular accounts are called standard accounts.

  • Home Directory

Linux OS has a separate home directory for a user. The files and directories created by a user are stored under a particular home directory. A user cannot store the files under any other user's directory, as it is not allowed to access the other user's directory. For example, the home directory of a user 'Alex' is automatically created as "/home/alex/" at the time of installation.

The Windows OS also has different home directories for different users. It is as "C:\ documents or \settings."

  • Other Directories

Linux systems have a tree structure to save the directories; comparatively, Windows uses different drives to save the directories. In Windows, system and program files usually take place in C drive. But in Linux, the system and program files take place in their specific directory such as software files are stored in /bin, programs and device files are in /dev, and boot files are stored in /boot directory.

  • Kernel

The basic part of any operating system is its kernel. It interacts with hardware devices and performs other functions such as process management, file handling, and more. Different operating systems have different kernels.

Linux and Windows have a different kernel. The Linux kernel is monolithic, and it consumes more running space. Comparatively, Windows uses the microkernel, which consumes less running spaces. But, Windows running efficiency is less than Linux. The key difference between Linux kernel and Windows kernel is that Windows is a commercial software while Linux is open-source software.

  • Pricing

Linux is an open-source operating system, so almost all the utilities and libraries are entirely free. The GNU/Linux distribution can be simply downloaded for free. However, some companies are providing paid support for their Linux distributions, but the underlying software is still free.

Microsoft Windows licensed copy usually cost between $99.00 and $199.00. Microsoft currently stops providing support for the earlier versions. The latest version, Windows 10, is available at $139.

Let's focus some head to head comparison between Linux and Windows.

ParameterLinuxWindows
AccessUsers can access the source code of kernel in Linux and can alter the kernel according to need.Usually, users cannot access the source code. However, members of some groups can have access to it.
VarietyLinux has several distributions that are highly customizable.Windows have fewer options to customize.
Command-lineThe command line usually referred to as Terminal, which is the most useful tool of the Linux system. It used for administration and daily tasks. For the end-users, it does not look so effective.Windows also have a command line, but it is not such effective as a comparison to the Linux terminal. Most users prefer the GUI options for daily tasks.
InstallationThe Linux installation process is a bit complicated to set up as it requires many user inputs. It takes less time than Windows to install.Windows OS is easy to install and set up on a machine; it requires fewer user input options during installation. However, it takes more time to install as compared to Linux.
Ease of useThe Linux OS is meant to be for the technical user because you must have some exposure to various Linux commands. Users may take more time to be a handy user of Linux. The troubleshooting process is also complicated as compared to Windows.Windows comes with simple and rich GUI options, so it is easy to use it. It can be simply used by technical as well as non-technical users. The troubleshooting process is also much easy than Linux.
Written inLinux is written in assembly language and C.Windows is written in C++ and assembly language.
ReliabilityLinux is highly reliable and secure. It has well-established system security, process management, and uptime.Windows is not as much reliable as Linux. However, now Windows has improved reliability but still has some security weaknesses and system instabilities.
SupportLinux has a

good support as it has a huge community of user forums and online search.

Windows also provide good support to its user. It provides free as well as paid support. It has an easily accessible online forum.
UpdateLinux provides full control to its users on updates. A user can install the update whenever needed. Also, it takes less time to install an update.Windows updates are annoying. The updates will come at any time and take too much time to install. Sometimes, you power on your machine, and updates are automatically getting started. Unfortunately, the user does not have much control over updates.
SecurityLinux OS is more secure than Windows. It is hard for the hackers and attackers to find a loophole in it. So, Linux is hard to breakthrough.Windows is less secure than Linux. Attackers primarily target the Windows for malware and virus. Windows is most vulnerable without anti-virus.
LicenseLinux is distributed under the GPL(GNU General Public License) license.Windows is distributed under a Proprietary commercial software license.

Unix Vs Linux

 Today Linux is in great demand. You can see the use of Linux everywhere. It's dominating on our servers, desktop, smartphones and even used in some electrical devices like refrigerators.

Some people think Unix and Linux as synonyms, but that's not true. Many operating systems were developed to be like Unix but none of them got the popularity as Linux. Linux is the clone of Unix. It has several features similar to Unix, still have some key differences. Before Linux and Windows, computer world was dominated by Unix. Unix is a copyrighted name and IBM AIX, HP-UX and Sun Solaris are only Unix operating system remained till date.


Difference between Linux and Unix

ComparisonLinuxUnix
DefinitionIt is an open-source operating system which is freely available to everyone.It is an operating system which can be only used by its copyrighters.
ExamplesIt has different distros like Ubuntu, Redhat, Fedora, etcIBM AIX, HP-UX and Sun Solaris.
UsersNowadays, Linux is in great demand. Anyone can use Linux whether a home user, developer or a student.It was developed mainly for servers, workstations and mainframes.
UsageLinux is used everywhere from servers, PC, smartphones, tablets to mainframes and supercomputers.It is used in servers, workstations and PCs.
CostLinux is freely distributed,downloaded, and distributed through magazines also. And priced distros of Linux are also cheaper than Windows.Unix copyright vendors decide different costs for their respective Unix Operating systems.
DevelopmentAs it is open source, it is developed by sharing and collaboration of codes by world-wide developers.Unix was developed by AT&T Labs, various commercial vendors and non-profit organizations.
ManufacturerLinux kernel is developed by the community of developers from different parts of the world. Although the father of Linux, Linus Torvalds oversees things.Unix has three distributions IBM AIX, HP-UX and Sun Solaris. Apple also uses Unix to make OSX operating system.
GUILinux is command based but some distros provide GUI based Linux. Gnome and KDE are mostly used GUI.Initially it was command based OS, but later Common Desktop Environment was created. Most Unix distributions use Gnome.
InterfaceThe default interface is BASH (Bourne Again SHell). But some distros have developed their own interfaces.It originally used Bourne shell. But is also compatible with other GUIs.
File system supportLinux supports more file system than Unix.It also supports file system but lesser than Linux.
CodingLinux is a Unix clone,behaves like Unix but doesn't contain its code.Unix contain a completely different coding developed by AT&T Labs.
Operating systemLinux is just the kernel.Unix is a complete package of Operating system.
SecurityIt provides higher security. Linux has about 60-100 viruses listed till date.Unix is also highly secured. It has about 85-120 viruses listed till date
Error detection and solutionAs Linux is open-source,whenever a user post any kind of threat, developers from all over the world start working on it. And hence, it provides faster solution.In Unix, users have to wait for some time for the problem to be resolved.

Linux Bash

The Linux Bash is also known as 'Bourne-again Shell.' It is a command language interpreter for the Linux based system. It is a replacement of Bourne shell (sh). It was developed under the GNU Project and written by Brian Fox. Nowadays, Bash is the default user shell of most of the Linux distributions.

The Linux/Unix shell allows us to interact with the Linux system through the commands. It let us invoke an executable file to create a running process. Moreover, it also allows us to interact with the Linux file system. It is designed in such a way that we can perform all the Linux operations through Bash.

The Bash is a command language interpreter as well as a programming language. It supports variables, functions, and flow control, like other programming languages. It can also read and execute the commands from a file, which is called a shell script.

It offers various functional improvements over Bourne Shell (sh) for both interactive and programming use. Although many sh scripts can be run by Bash without any change. The Bash contains the following improvements over sh:

  • It provides command-line editing
  • It contains unlimited size command history
  • It provides Job Control
  • It facilitates with Shell Functions and Aliases
  • It provides the indexed arrays of unlimited size
  • It contains integer arithmetic in any base from 2 to 64.

How to download Bash

It can be downloaded from the official GNU server via both HTTP (http://ftp.gnu.org/gnu/bash/) and FTP (ftp://ftp.gnu.org/gnu/bash/ ) servers.

People often get confused between bash, shell, and shell script. Let's walk through shell and scripting to clear a picture of bash, shell, and scripting.

What is Shell

If we are a new Linux user, and we open the terminal, it is assumed that we are well confused as to what to do with it. Here the Shell comes in the role.

The terminal contains the shell; it allows us to execute the commands to interact with the system. We can perform various operations such as store and retrieve data, process information, and various other simple as well as complex tasks.

To open the terminal, press CTRL+ALT+T keys. Perform some basic operations such as date, cal, ls, and pwd to take a tour with it.

Consider the below image:

Linux Bash

As we can see from the above image, the shell allows us to interact with the Linux system. When we have executed the date and cal command, the shell interacts with the system and retrieves data.

What is Scripting

Suppose we are required to execute some basic commands every day, for example above four commands. Linux supports a feature called scripting that allows us to execute more than one task at once. So, it is good to define a script rather than performing repetitive tasks.

To understand how to use Linux script, let's define a script in a combination of some tasks. To define a script, create a file with a .sh extension. We are using the VI text editor. However, any text editor can be used to define a script. Consider below command:

  1. vi tasks.sh  

The above command will open the vi editor in normal mode. Switch it to insert mode by pressing ESC, and after that enter 'i' keys, enter your desired tasks. Every task should be defined in a new line. Consider the below tasks:

  1. date  
  2. cal  
  3. pwd  
  4. ls  

After entering the tasks, press ESC and :wq! Keys to save and exit from the editor.

Now, make the created file as executable, use the chmod command with +x option as follows:

  1. chmod +x tasks.sh  

We have created our first script. To execute the shell script, execute the file name by predefining './ ' with the file name. Consider the below command:

  1. ./task.sh  

Consider the below output:

Linux Bash

As we can see from the above output, by using the shell, we can automate the tasks. We can use this whenever we need it. It can be used repeatedly any number of times.

Features of Bash

All the built-in command of the sh shell is available in Bash; moreover, it facilitates us with many other features. Some key features of Bash are as follows:

  • Shell Syntax: The shell syntax contains shell operationsquoting, and comments. The shell operations are the basic operation of the shell. Quoting allows how to remove the special meaning from characters, and comments are meant to specify the comments.
  • Shell commands: Shell commands are the types of commands that you can execute. These commands can be simple commands, pipelines, lists, compound commands, and more.
  • Shell Functions: Shell functions are used to group commands by name. They are executed as traditional commands. When we use the name of a shell function, the list of commands associated with that is executed.
  • Shell parameters: Basically, a parameter is an entity that stores value; it can be a name, number, or special character. The shell parameters specify how the shell store value. They can be a positional parameter or a special parameter. Positional parameters are the shell's command-line arguments, and the special parameters are denoted by a special character.
  • Shell Expansions: Shell expansion is a technique that is used by Bash to expand the parameters. Expansion is performed on the command line after the input has been splitted into tokens.
  • Redirections: It is a way to manage and control the input and output.
  • Command execution: It decides how the system will react when we execute a command.
  • Shell Scripts: It is a text file that has shell commands and executes them when it is used. Bash reads and executes the commands then exits.

Linux Features

 

  • Multiuser capability: Multiple users can access the same system resources like memory, hard disk, etc. But they have to use different terminals to operate.
  • Multitasking: More than one function can be performed simultaneously by dividing the CPU time intelligently.
  • Portability: Portability doesn't mean it is smaller in file size or can be carried in pen drives or memory cards. It means that it support different types of hardware.
  • Security: It provides security in three ways namely authenticating (by assigning password and login ID), authorization (by assigning permission to read, write and execute) and encryption (converts file into an unreadable format).
  • Live CD/USB: Almost all Linux distros provide live CD/USB so that users can run/try it without installing it.
  • Graphical User Interface (X Window system): Linux is command line based OS but it can be converted to GUI based by installing packages.
  • Support's customized keyboard: As it is used worldwide, hence supports different languages keyboards.
  • Application support: It has its own software repository from where users can download and install many applications.
  • File System: Provides hierarchical file system in which files and directories are arranged.
  • Open Source: Linux code is freely available to all and is a community based development project.

Why Use Linux

Linux is completely different from other operating systems in many ways.

  • It is an open source OS which gives a great advantage to the programmers as they can design their own custom operating systems.
  • It gives you a lot of option of programs having some different features so you can choose according to your need.
  • A global development community look at different ways to enhance its security, hence it is highly secured and robust so you don't need an anti virus to scan it regularly. Companies like Google, Amazon and Facebook use linux in order to protect their servers as it is highly reliable and stable.
  • Above all you don't have to pay for software and server licensing to install Linux, its absolutely free and you can install it on as many computers as you want.
  • Its completely trouble free operating system and don't have an issue with viruses, malware and slowing down your computer.

Linux History

Evolution of Computer

In earlier days, computers were as big as houses or parks. So you can imagine how difficult it was to operate them. Moreover, every computer has a different operating system which made it completely worse to operate on them. Every software was designed for a specific purpose and was unable to operate on other computer. It was extremely costly and normal people neither can afford it nor can understand it.

Evolution of Unix

In 1969, a team of developers of Bell Labs started a project to make a common software for all the computers and named it as 'Unix'. It was simple and elegant, used 'C' language instead of assembly language and its code was recyclable. As it was recyclable, a part of its code now commonly called 'kernel' was used to develop the operating system and other functions and could be used on different systems. Also its source code was open source.

Initially, Unix was only found in large organizations like government, university, or larger financial corporations with mainframes and minicomputers (PC is a microcomputer).

Unix Expansion

In eighties, many organizations like IBM, HP and dozen other companies started creating their own Unix. It result in a mess of Unix dialects. Then in 1983, Richard Stallman developed GNU project with the goal to make it freely available Unix like operating system and to be used by everyone. But his project failed in gaining popularity. Many other Unix like operating system came into existence but none of them was able to gain popularity.

Evolution of Linux

In 1991, Linus Torvalds a student at the university of Helsinki, Finland, thought to have a freely available academic version of Unix started writing its own code. Later this project became the Linux kernel. He wrote this program specially for his own PC as he wanted to use Unix 386 Intel computer but couldn't afford it. He did it on MINIX using GNU C compiler. GNU C compiler is still the main choice to compile Linux code but other compilers are also used like Intel C compiler.

He started it just for fun but ended up with such a large project. Firstly he wanted to name it as 'Freax' but later it became 'Linux'.

He published the Linux kernel under his own license and was restricted to use as commercially. Linux uses most of its tools from GNU software and are under GNU copyright. In 1992, he released the kernel under GNU General Public License.

Linux Today

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.