Session 2: Hello Linux :)

Session 2: Hello Linux :)

download (1).png

Linux is an open-source Unix-like operating system based on the Linux kernel

In order to access Linux i have used Oracle VirtualBox 6.0.24 & I have configured CentOS 7 in it.

Use the below mentioned link to download both the resources :

VirtualBox: https://www.virtualbox.org/wiki/Downloads

Centos: http://isoredirect.centos.org/centos/7/isos/x86_64/

UI of virtual Box for your reference:

image.png

now the question arises that why to use linux ?

Here are some advantages of using linux OS :

  • Open Source
  • Security
  • Revive older computer systems
  • Customization, can be customized as per the requirement.
  • Large Community Support
  • Performance & Stability (Reliability)
  • Cost is low as compare to other OS available in the market
  • Fast and easy installation
  • Run multiple desktops
  • Different Flavors available

logo-distros-for-linux.jpg

Architecture of Linux

image.png

1. Hardware − Hardware consists of all physical devices attached to the System. For example: Hard disk drive, RAM, Motherboard, CPU etc.

2. Kernel − Kernel is the core component for any (Linux) operating system which directly interacts with the hardware.

3. Shell − Shell is the interface which takes input from Users and sends instructions to the Kernel, Also takes the output from Kernel and send the result back to output shell.

4. Applications − These are the utility programs which runs on Shell. This can be any application like Your web browser, media player, text editor etc.

Linux Package installer

In simpler words, a package manager is a tool that allows users to install, remove, upgrade, configure and manage software packages on an operating system.

RPM (Red Hat Package Manager)

This is the Linux Standard Base packing format and a base package management system created by RedHat.

Only root or users with sudo privileges can install or remove RPM packages.

To install an RPM package with the rpm, use the -i option, followed by the package name:

sudo rpm -ivh package.rpm

YUM (Yellowdog Updater, Modified)

It is an open source and popular command line package manager that works as a interface for users to RPM. below are the examples of yum commands:

NOTE: YUM resolves and installs package dependencies automatically.

A brief difference between RPM & YUM.

image.png

Virtualization — (taken reference from Redhat)

Virtualization is technology that lets you create useful IT services using resources that are traditionally bound to hardware. It allows you to use a physical machine’s full capacity by distributing its capabilities among many users or environments.

How does virtualization work?

Software called hypervisors separate the physical resources from the virtual environments — the things that need those resources. Hypervisors can sit on top of an operating system (like on a laptop) or be installed directly onto hardware (like a server), which is how most enterprises virtualize. Hypervisors take your physical resources and divide them up so that virtual environments can use them.

image.png

Resources are partitioned as needed from the physical environment to the many virtual environments. Users interact with and run computations within the virtual environment (typically called a guest machine or virtual machine). The virtual machine functions as a single data file. And like any digital file, it can be moved from one computer to another, opened in either one, and be expected to work the same. When the virtual environment is running and a user or program issues an instruction that requires additional resources from the physical environment, the hypervisor relays the request to the physical system and caches the changes — which all happens at close to native speed (particularly if the request is sent through an open source hypervisor based on KVM, the Kernel-based Virtual Machine).

Types of Hypervisor:

image.png

Type 1 provides direct interaction to the hardware, and it can run directly on the host’s hardware and control it

In type 2, an operating system is needed to interact with the hardware. The Hypervisor is installed along with the operating system.

Basic Linux commands:

1) cd To navigate through the Linux files and directories, use the cd command.

2) ls

The ls command lists files and directories within a system.

3) ls -l

The ls -l command shows file or directory, size, modified date and time, file or folder name and owner of the file, and its permission.

4) pwd

The pwd command is used to find the path of your current working directory.

5) mkdir

The mkdir command is used to create one or multiple directories at once and set permissions for each of them.

6) touch

The touch command allows you to create an empty file or generate and modify a timestamp in the Linux command line. 7) chmod

The chmod is a command that modifies a file or directory’s read, write, and execute permissions. In Linux, each file is associated with three user classes — owner, group member, and others.

Understanding File permission in Linux:

image.png

image.png

Here’s how it works:

Now, if we represent each of the three sets of permissions (owner, group, and other) as a single digit, we have a pretty convenient way of expressing the possible permissions settings. For example, if we wanted to set some_file to have read and write permission for the owner, but wanted to keep the file private from others, we would:

image.png

Thank you for reading, I’ll be posting hands on commands performed in my configured CentOS so that all these commands will make more sense.

stay tune for the same…

Did you find this article valuable?

Support cloudwithshubham by becoming a sponsor. Any amount is appreciated!