Easiest Introduction to Linux

Easiest Introduction to Linux

In order to understand Linux, we have to first understand Operating System first, so first let's start with Operating System.

Introduction to Operating System

Which operating system do you use? Are you on Windows, Mac or even Andriod? Have you ever wondered how your apps and software actually work? Like really really work? What happens behind the scenes?

Here's an example of all the stages of communication via the Operating System.

  1. Here hardware interacts with the BIOS

  2. BIOS interacts with the Kernel.

  3. Kernel is a part of the Operating System that interacts with the Applications.

  4. And finally, we as users interact with the application.

Now let's define each of those to reach our OS

The hardware consists of the physical component. We know about them. They include CPU, Ram and Storage.

BIOS is a mini program that is stored in the ROM of the computer. If you don't remember, ROM is the memory of a computer that cannot be changed. That's why it's called read-only memory. You can only read it. Whereas RAM (Random Access Memory) is the memory of a computer that can be changed. That's why there is a random in the name.

Kernel is the heart of the Operating System. When you make a request via application, it goes to the Kernel which then converts the requests into machine language and interacts with the hardware. The kernel is responsible for the allocation of the resources of CPU, RAM and Storage to the application according to their needs.

Now our awaited part:

Operating System

In easy language operating system is the playground we use to play our games. Now you can also play your games in your street but you see there are a lot of adjustments you need to make and you can't play with full efficiency.

Similarly, the operating system is a place that we use to run our applications. Now applications can also be run without the operating system but a lot of extra code has to be written and still then we won't be able to run the apps with full efficiency.

The first operating system was called UNICS later called UNIX which was developed in 1971

When it was first released it was made free to be used by universities and research institutions. But after a few years, the company that owned rights to UNIX started licensing the software and started selling it at an extremely high price.

So a lot of companies started doing the same and created their own OS which was based on the UNIX-based kernel. This made it difficult for normal people to purchase an OS.

Enter the guy Linus Torvalds

Linus wanted to learn computers but didn't have money to buy an operating system. He was pissed off looking at the situation. So he decided to create his own kernel. He spent years and eventually came up with the kernel named Linux from scratch.

It is meant that Linux is also UNIX based kernel which is incorrect because Linus build the Linux kernel from scratch. Of course, he took his understanding from UNIX and that's why some people say that it's a clone of a UNIX-based kernel.

You see LINUX sounding similar to UNIX is just a coincidence. It's LINUX because of Linus.

So, It was in the '90s and parallelly when Linux was being made there was a movement going on during that time called the free software movement (GNU) which was creating and promoting open source free software.

They collaborated with the LINUX kernel and by combining this GNU with the LINUX, we found our first open-source operating system which was free to use by everybody. Not only that its code base was also available for free to modify and make necessary changes by the community.

After the Linux kernel was introduced, things again begin to commercialize.

A lot of operating systems were introduced as well like ubuntu, centos, fedora and Red Hat, Amazon Linux, and Kali Linux which were based on Linux kernel.

Each has its own pros and cons and all of them are free to use with their own enterprise version.

Ubuntu is the most popular Linux-based operating system.

Note: Everyone means Linux when they refer to an operating system. We will consider the same here for our mutual understanding.

It's similar to when you say you want a xerox but xerox is not the right word. Photocopy is the right word. Xerox is the company.

So how is Linux different from Windows or Mac?

Well, the major difference between Linux and Windows is the way we interact with the operating system. In windows to open an item, we double-click on it, to move an item we drag and drop. We basically see whatever is in front of us. Things are not same with the Linux. You might have opened this command prompt in windows. The black screen in which we don't understand anything. That is also a place to run your computer. You can do all the copy and paste there as well including the configuration. But that is not very user-friendly.

Linux doesn't have anything except for that command prompt or terminal whatever you want to say. Such operating systems are called CLI (Command Line Interface) where you interact with apps only through commands. The operating system of windows is called GUI (Graphical User Interface) where you interact with apps majorly through graphics.

Here are the major differences between both:

CLIGUI
In CLI you run your commands or software via the command line interface (cmd) in windows and the terminal in macIn GUI you use your mouse and clicks to run the software and commands. Even in them in the backend commands are being run
CLI is fast.GUI is slow.
Hard to learn because of a lot of commands.GUI is easier to learn because of graphical interface.

Nowadays the Linux operating system is also GUI but the company still prefers to use the CLI version only.

Benefits of Linux?

  1. It's free to use.

  2. It's lightweight.

  3. Its code base is Open Source. You can literally change anything you don't like in your operating system which gives you more control.

  4. It's extremely fast because of CLI

  5. Configuration, installation and management of servers are well managed on CLI than on GUI

  6. Multiple users could easily work on it.

  7. Hard to attack Linux Servers because hackers have to memorize thousands and thousands of commands.

  8. Viruses don't spread in Linux. They stay in their respective folder only.

How can I install Linux?

If you are on a mac you can simply play around in your terminal. It supports all Linux Commands. If you are windows you have 2 options either to install a Linux Machine one a virtual box which I don't personally use because.

I would recommend you install Ubuntu LTS (Long Term Support) version from the Microsoft store and use the terminal app in the store to access it. You need to enable WSL2 on your machine but I recommend you watch a tutorial to enable it.

Once you are done setting up, your screen should look something like this:

Linux Users:

  • Here khushal refers to the user name

  • @DESKTOP-8PAS1RO refers to your pc name.

  • And most important $ refers to the regular user through which you are logged in.

  • If there is a # in the end it means you are a root user which is similar to the administrator in windows.

Before starting out first let's go to the home of Linux

cd ~

This will change your current folder to the home folder of Linux

And then do some update

sudo apt-get update

This will update your Linux system. Here sudo means using this command as a root user. That's why you were asked for the password for a regular user.

Once you are done, then let's start with basic Linux commands:

12 most used Linux Commands:

You don't need to memorize thousands of commands, to get started with Linux. You'll remember what's important for you in the journey. And for the start, these 9 commands are way more than enough.

Before getting started, do note that the folder is called a directory and software is called a package in the world of Linux.

I'll start with my favorite command:

clear

It clears the screen. I just love this command.

ls

ls refers to list. It shows all the folders and files in your current system. I would highly recommend you google the name behind the command. Just like the list is used here for ls. It helps to understand Linux better.

pwd

It stands for print working directory. It tells you the path where you are currently present.

ls -a

Here ls stands for list and -a stands for all It shows all the files and folders in your directory including the hidden files and folders

mkdir folder1

Here mk refers to make, dir refers to directory and folder1 is the name of my folder. mkdir is used to create a folder.

cd dir1

Here cd stands for change directory and dir1 is my folder/directory Here I am entering into the folder. It's like a double click in GUI.

Do note that Linux Commands are case-sensitive meaning you cannot type cd Dir1. It won't open any folder here.

cd ..

This command is simply used to go back to the previous directory. If you'll do cd. which consists of a single dot, you'll stay in the same directory.

touch file1

Here touch is used to create an empty file

cat file2

This will show what you have written in that file

rm -rf file1

Do note that -rf is the same as -r -f. Here rm stands for remove, -r stands for file/folder and -f stands for forceful removal This command removes the selected file or folder

I started with my favorite command and would like to end with my other favorite command as well:

rm -rf *

This command removes everything in the present file or folder Do note that there is no recycle bin in Linux. Once the file or folder is gone. It's just gone forever.

Well, that's it for today. Let me know if I helped! Reviews are highly appreciated.