Linux Basics

Linux Basics

In this article we will see basics of Linux operating systems and basic commands which will be helpful...!

·

4 min read

About Linux:

  • Open Source OS

  • The older computer can be revived using Linux

  • Secured

  • Various distributions can be done using Linux

  • Free to use

  • The cost of Linux is low. Spinning a server for Linux will be low when compared to the Windows OS

  • Has large community support

Flavors of Linux OS:

Linux Architecture:

Hardware – Physical part of the computer like CPU(Central Processing Unit), hard drive, RAM and other devices connected to the CPU

Kernel – It is a computer program and is the core part of the operating system. It is the interface between the Software and the hardware components of the system.

Shell - A Shell is a command line interprets which interprets the commands that we have entered using a keyboard and sends it to the OS i.e) Kernel to operate. The output from the kernel will be interpreted by the Shell and displayed as the output to the users.

Example: If we want to access a calculator application, we enter the input through the keyboard to the Shell. The shell interprets the input which was entered through the keyboard and sends the request or instruction to the kernel to perform the operations. Now the kernel will understand what exactly is the operation that needs to be performed and it will push that to the hardware in a language that the hardware can understand such as the assembly language. Now the hardware will do the requested operation for us and will send it back to the kernel and the kernel will send it back to the shell from where users can view it as the output.

Other Terminologies:

Package Managers

Package managers help users to search, download, install, update, and remove software applications from their computers. It automatically computes dependencies and figures out what things should occur to install packages.

Packages

Linux distributions created their own packaging format to provide the end users with ready-to-use binary files (precompiled software) for installing software along with some metadata (version number, description) and dependencies. To use the packages, we need a package manager. A package may have dependencies. Meaning that it may require other packages to be installed. The package manager often takes care of the dependencies and installs them automatically along with the package you are installing.

Repository

Collection of software packages and metadata

Metadata

Contains the name of the package, version number, description of the package and repository name etc.

Package Managers

  • .deb – (Debian Package File)

  • .rpm – (Red Hat package manager)

  • .yum – (Yellow Dog Updater Modified)

Difference between RPM and YUM

RPM (Red Hat Package Manager)

YUM (Yellow Dog Updater, Modified)

Does not resolve dependencies.

Resolves and installs package dependencies automatically.

However, only a single package installation is possible at a time.

On the other hand, YUM can install multiple packages simultaneously.

RPM doesn’t support automatic upgrades.

YUM allows automatic upgrades to the latest available version.

RPM doesn't support change rollback.

YUM allows any changes to be rolled back.

What is Hypervisor?

Hypervisor also known as a virtual machine monitor is software which creates and runs the virtual machine. A hypervisor allows one host computer to support multiple guest VMs by virtually sharing its resources, such as memory and processing.

Eg: VMWare, VirtualBox is the name of the software which works on hypervisor architecture

Types of Hypervisor:

  • Type-1 Hypervisor – Bare Metal Hypervisor. Eg: VMWare

  • Type-2 Hypervisor – Hosted Hypervisor. Eg: Oracle Virtual Box

How to open the Terminal?

Right Click on the desktop and click open Terminal

Linux Commands

Command

Explanation

Whoami 

 displays the username of the current user

ls 

  displays the list of files and directories within the system

cd Desktop/ 

 to navigate through the files and directories i.e) to change the directory

mkdir demo 

 to create a new directory in a particular location or directory

touch demo.txt 

 used to create a file with the given extension in the current directory

rm demo.txt  

 used to delete the file from the current directory

ls -l 

 displays additional information like permission, number, Owner, group to which user belongs, size of the file, modified date and time of the current directory or file, name of the file

chmod 467 demo.txt  

 to modify the read, write, and execute permissions for 3 user classes (Owner, group, member)

Permission Values are in the combination of (4,2,1)

To update the centOS:

  • We need to be root user

Add-on Tips:

  • $ denotes are in the home directory as normal user

  • # denotes we are in the root directory as the root user

  • Type the commands and type 3 letters of any file name in that current directory. Click Tab. The file name will be auto-filled

Thanks for Reading....! Happy Learning !!!

-Makesh