LSP Unit 1
LSP Unit 1
LSP Unit 1
Operating System: -
An operating system acts as an intermediary/interface between computer user and computer
hardware. The operating system is designed in such a way that it can manage the overall
resources and operations of the computer. It is a fully integrated set of specialized programs
that handle all the operations of the computer. It controls and monitors the execution of all
other programs that reside in the computer, which also includes application programs and
other system software of the computer.
An operating system is an integrated set of specialised programs that are used to manage
over all resources and operations of the computer.
You interact with an operating system through a user interface, which allows the operating
system to receive and interpret instructions sent by the user. You need only send an
instruction to the operating system to perform a task, such as reading a file or printing a
document. An operating system’s user interface can be as simple as entering commands on
a line or as complex as selecting menus and icons on a desktop.
The computer system can be divided roughly into four components: the hardware, the
operating system, the application programs and the user such that: -
Basic Terms: -
1. Software: - Software is a set of programs (sequence of instructions) that allows the
users to perform a well-defined function or some specified tasks.
The software is made up of binary language (composed of ones and zeros), and for a
programmer writing the binary code would be a slow and tedious task. Therefore,
software programmers write the software program in various human-readable
languages such as Java, Python, C# (pronounced as C-Sharp), etc. and later use the
source code.
Types of Software: -
Software's are broadly classified into two types, i.e., System Software and Application
Software
a) System software: - System software is a computer program that helps the user to run
computer hardware or software and manages the interaction between them. They are
the first thing that gets loaded in the system's memory wherever you turn on your
computer. System software is also known as "low-level software" because the end-
users do not operate them.
Example: -
Operating System: -It is a group of software that handles the execution of programs
and offers general services for the application that runs over the computer. Like: -
Microsoft Windows, Macintosh, Linux, Unix etc.
Device Drivers: -The device driver is a type of software that operates or controls
some specific hardware devices linked to your system. Like: -BIOS Device Driver,
Display, USB, Printer Device Driver etc.
2. Hardware: - Hardware refers to the physical and visible components of the system
such as a monitor, CPU, keyboard and mouse.
3. User Interface: - The User interface is an interface through which a human being
interacts or communicates with a device. You interact with an operating system
through a user interface, which allows the operating system to receive and interpret
instructions sent by the user. You need only send an instruction to the operating
system to perform a task, such as reading a file or printing a document.
User interface can be as simple as entering commands on a line or as complex as
selecting menus and icons on a desktop.
Frontend and backend are the two most popular terms used in web-development.
Frontend: - this is termed as the part of website which is used by user to interact with it.
Everything that is included there for user interface on website. It is also termed as client-
side interface.
How the frontend is implemented?
HTML, CSS, JavaScript, react.js, jQuery etc.
Backend: - The part of the website which is used for the server side and the clients can not
see or interact with it. It stores and arranges the data. Example: - Data entered by user using
the Registration Form including user-id, password etc.
How the backend is implemented?
PHP, Java, Python, Node.js, C++, Django framework etc,
In HTML5, there is no need to specify the type of document using version of HTML like
there was in HTML4. You can simply use: -
<!doctype html>
How to start a tag: - <html>
How to end a tag: - </html>
The structure is as follows: -
<!doctype html>
<html>
<head>
<title>
</title>
</head>
<body>
------
------
</body>
</html>
Example: - To show the difference between <p> and <pre> tag: -
Output: -
Introduction to Linux: -
Linux is a fast and stable open-source operating system. Linux was developed in the early
1990s by Linus Torvalds, along with other programmers around the world. As an operating
system, Linux performs many of the same functions as Unix, Macintosh, Windows.
However, Linux is distinguished by its power and flexibility, along with being freely
available.
• Linux is a famous version of UNIX OS.
• History Facts: -
Linux was developed by Linus Torvalds, while a student at the University of
Helsinki in Finland, with the help of hundreds of programmers scattered around
the world across the Internet.
Linus took MINUX and UNIX like OS developed by Andrew Tannenbaum, as
inspiration.
Features of Linux: -
The features of Linux are as follows: -
• Open-Source: - Source code is freely available on the internet. Anyone capable of
coding can contribute, modify, enhance and distribute the code to anyone and for any
purpose. It can be downloaded from internet completely for free. No registration fees,
no costs per user, free updates, and freely available source code, If you want to
change the behaviour of your system.
• Portable: - The kernel of Linux supports the installation of any type of hardware
environment.
• Multi-User: - More than one user can use the resources of the computer system. A
Multi-user operating system is a computer operating system which allows multiple
users to access the single system with one operating system on it.
• Flexible: - Linux provides a high range of flexibility as you can install only required
components. There is no need to install a full or complete suite. You can also keep
Linux file under multiple partitions so if one of them corrupts then there is no major
loss. You only need to repair that particular partition, not the complete file which is
not the case with other operating systems.
• Scalable: - A scalable system is one that can handle rapid changes to workloads
and user demands. Scalability is the measure of how well that system responds to
changes by adding or removing resources to meet demands.
• Stability (Reliability): - Linux provides high stability also this is good advantage
i.e., it does not need to be rebooted after a short period of time. Your Linux system
rarely slows down or freezes. As in windows, you need to reboot your system after
installing or uninstalling an application or updating your software but this is not the
case with Linux. You can work without any disturbance on your Linux systems.
• Fast and easy installation: - Linux can be easily installed from the web and does not
require any prerequisites as it can run on any hardware, even on your oldest systems.
________________________________________________________________________
Linux Architecture: -
The Linux operating system's architecture mainly contains some of the components: -
1. Hardware
2. Kernel
3. Shell
4. Application Utilities
5. User
Resource Management
Memory Management
Process Management
File Management
Date & time services
• Shell: - It is an interface between the user and the kernel. The kernel does not know
human language; hence the shell accepts the commands from the user from and
converts them into a language that the kernel can understand. The shell, or the
command interpreter as it is called, is the mediator, which interprets the commands
and conveys them to the kernel which ultimately executes them.
Two major parts of shell: -
1. Interpreter: reads out commands and works with kernel to execute them.
2. Programming capability that enables us to write a shell script. (Shell script is a file
that contains a collection of shell commands to perform a specific task. It is known
as a shell program.)
Types of shells: - Different programmers implemented the interpreter functioning in
different ways. So, there are various types of shells available like Bourne shell, C
shell, Korn shells, BASH shell (Bourne Again Shell).
Bourne Shell - It is the primary UNIX command interpreter and was the first
major shell. It was developed by Steve Bourne at the AT&T Labs. This shell
was released in 1977 and was called “sh”. By default, it uses the prompt # for
the root user and $ for the non-root users.
C Shell – The C shell, created by Bill Joy, has some special facilities that are
not available in Bourne Shell. It provides the facility of aliasing of commands
(Aliasing of commands means one can rename the lengthy commands) and
command history feature. By default, it uses the prompt hostname# for the
root user and hostname% for the non-root users. We can shift to this shell by
using “csh” command. The C shell got its name because its syntax and usage
is very similar to the C programming language. A compatible version of the
C shell, ‘tcsh’ is used in Linux.
Korn Shell – The Korn shell was developed at AT&T Bell Labs by David
Korn, to improve the Bourne shell. It is denoted as ksh. The Korn shell is
essentially a superset of the Bourne shell. By default, it uses the prompt # for
the root user and $ for the non-root users.
[If you are using Ubuntu, then a login window will appear like this. After entering password,
you will get shifted to Ubuntu.]
Ubuntu Desktop: -
At the login prompt, we type the username (a unique name provided by the administrator).
After having typed the username, we are prompted for a password. The password entered
here is encrypted and does not appear such that: -
After successful login, you will be allowed to login the system and be navigated to home
directory, the directory in which personal files and settings are stored. In addition, a message
indicating when we last logged in, along with the shell prompt is displayed: -
_______________________________________________________________
Shutting Down the Linux System: -
If you want to shut down the system, then you can shut down either by using commands or
by using GUI.
1. Using Commands: -
• To shut down the system immediately, type “shutdown -h now": -
• Using “shutdown -P”, you can shout down like simple “shutdown” command
without arguments. Here, “p” stands for “poweroff”
• To shutdown immediately, you can use “poweroff” command too, but here,
you will require password, if used with sudo. After entering the password, the
system will shut down.
• Using “poweroff” without sudo will not require password.
2. Using GUI: -
• Right Click on the top-right corner. A pop-up menu will appear.
• Click on “Power Off/Log Out” drop-down option.
• Now, click on: -
“Power Off” to shut down
“Restart” to restart
“Switch User” to switch the user
“Log Out” to logout from your account
_______________________________________________________________
Linux Distributions: -
A Linux distribution is the customized version of Linux. In simple terms, it is a collection
of packages and applications grouped and pre-installed on standard Linux to meet specific
requirements. All Linux distributions with less or more customization use the same Linux
kernel.
Since all Linux distributions use the same Linux kernel at their core, no matter which Linux
distribution you use, you will get all features and functions of standard Linux across all
distributions. In other words, once you learned how to use or manage Linux of one
distribution, you can use the same skills and experiences to manage and use Linux of other
distributions.
Differences between distributions: -
• The first major difference between various Linux distributions is their target
audiences and systems. For example, some distributions are customized for
desktop systems, some distributions are customized for server systems, and
some distributions are customized for old machines, and so on. Usually,
distributions are designed for specific purposes or to provide an environment
to perform particular functions.
• The second major difference between distributions is the process of installing
and updating applications. Different distributions use different application
installation and management tools, called package management tools.
• The next big difference is how distributions provide supports and updates.
Some distributions are maintained by a community of volunteers while others
are maintained and supported by a commercial vendor. If a distribution is
maintained by a community, you will get all updates and supports free of cost.
But if a distribution is maintained by a commercial vendor, you may have to
pay for support services, updates, and maintenance.
2. CentOS Linux
CentOS Linux is a derivation of RHEL. It uses all source codes of
RHEL without branding and artwork. If you want to use RHEL Linux
without paying a subscription fee for additional support, CentOS is the
best choice for you.
When Red Hat Inc. (IBM) releases a new version of RHEL or releases
an update of the existing version of RHEL, the developer community
of CentOS makes a clone copy of that release by using the same source
code and release that copy under the CentOS brand name.
CentOS Linux is the replica of RHEL Linux without brand name and
support. For support, you have to rely on the developer community of
the CentOS.
Many other distributions are also derived from RHEL such as
Scientific Linux and Oracle Linux. Unlike CentOS, these distributions
are not replicas of RHEL. These distributions use RHEL's source code
as the base platform and build their distributions.
3. Fedora Linux
Fedora project is sponsored by RHEL. Red Hat uses Fedora as a testing
ground to test its new features. Many features introduced in Fedora
usually make their way into the new version of RHEL. Red Hat does
not provide any support for Fedora Linux. For support, you have to
rely on the community of volunteers.
Fedora Linux is a good choice for instructors who provide Linux
training or for developers who develop software for RHEL Linux. It
allows instructors and developers to learn, understand, and use new
features even before they become available for all.
Since Fedora is a testing platform, it should not be used for commercial
use.
4. SUSE Linux
After Red Hat Enterprise Linux, SUSE is the next stable and popular
enterprise Linux for servers, and mainframes computers. SUSE is
developed and maintained by SUSE Software Solutions (Germany).
Just like Red Hat Linux, you can install, test, and use SUSE Linux
without paying a fee to SUSE. But if you need support and update,
then you have to purchase a paid subscription. SUSE Linux is suitable
for enterprise-size networks.
5. Debian Linux
The Debian Linux is a pure community based free Linux distro. It is
developed, managed, distributed, and updated by the largest volunteer-
based community. This project was started in 1993. For software
installation and management, it uses the dpkg packaging system.
Debian Linux is a good choice if you want a completely free Linux.
The Debian distribution commits toward freedom, openness, and
maintaining a focus on delivering what users want. Several popular
Linux distributions have been derived from Debian Linux.
Another main reason to choose this distro is that it has the largest
collection of software packages in its pool. It contains over 59000
packages, precompiled software bundled up in a nice format for easy
installation on your machine.
6. Gentoo Linux
Gentoo is also a community-based Linux distribution. The main
feature of this distribution is that it allows us to compile the entire
Linux from the source code on our computer. We can customize every
option and application that suit our hardware platform and meet our
requirement.
If you are a Linux developer or an advanced user and need a Linux that
contains only what you want, this is a perfect choice.
7. Ubuntu Linux
Ubuntu is based on the Debian Linux. Ubuntu is funded and supported
by Canonical Ltd. Before Ubuntu, Linux was known as the operating
system of developers or network administrators. It was not popular
among desktop or GUI users.
Ubuntu changed this trend by providing Windows-like GUI
environment and tools. Shortly after its launch, Ubuntu became the
most popular and used Linux distribution. If you are looking for an
easy-to-use and free Linux, then Ubuntu should be your first choice.
Ubuntu also offers its customized versions. These versions are known
as Ubuntu flavors. Each Ubuntu flavor is customized for different
requirements and purposes. To learn about these flavors in detail, you
can check the following tutorial.
Ubuntu Flavors: - Types of Ubuntu
A lot of other Linux distributions are also derived from Ubuntu such
as Linux Mint, elementary OS, Zorin OS, and Pop!_OS. The main
difference between Ubuntu-based Linux distributions and Ubuntu
flavors is that Ubuntu-based Linux distributions are developed and
maintained by third parties while Ubuntu flavors are developed and
maintained by the same team that develops and maintains the Ubuntu.
8. Arch Linux
Arch Linux is a lightweight and flexible distribution. This distribution
contains only essential and stable versions of the software. If you have
an old system and need a lightweight Linux distribution, this is a
perfect choice.
9. KNOPPIX Linux
KNOPPIX Linux is based on Debian Linux. This distribution
provides a compact and live version of Linux. You can install it on
any removable device such as CD, DVD, and USB drive. Once
installed, you can run KNOPPIX Linux from the removable device.
To use KNOPPIX Linux, boot the system from the removable device.
When you boot a system from the removable device that contains
KNOPPIX Linux, the KNOPPIX Linux automatically detects and
configures the hardware of the host computer.
After booting, you can use the KNOPPIX Linux just as it is installed
on the hard disk of that computer.
10.Kali Linux
Kali Linux is also based on Debian Linux. This Linux is mainly
customized for testing the security of network and system. This
distribution comes with a lot of tools that are used in hacking,
cracking, and testing networks and web applications.
If you are an ethical hacker or need a Linux for ethical hacking
purposes, this is the best choice for you. Frankly, there is no better
distribution than Kali Linux for ethical hacking purposes.
_______________________________________________________________
Comparison of Linux with other OS: -
1. Linux vs Unix: -
Linux: - Linux is an open-source operating system. This OS is supported on
several computer platforms and includes multiple software features that handle
computer resources, and allow you to do tasks. This operating system was
launched by Linus Torvalds at the University of Helsinki in 1991.
Unix: - Unix is a powerful and multitasking operating system that behaves like
a bridge between the user and the computer. It allows the user to perform specific
functions. This operating system was launched in 1960, and was released by
AT&T Bell Labs.
Features Linux Unix
Basic Linux is an open-source operating Unix is a powerful and multitasking
Definition system. This OS is supported on several operating system that behaves like a
computer platforms and includes bridge between the user and the
multiple software features that handle computer.
computer resources, and allow you to
do tasks.
Launched This operating system was launched by This operating system was
by Linus Torvalds at the University of launched in 1960 and released by
Helsinki in 1991. AT&T Bell Labs.
OS family It belongs to the Unix-like family. It belongs to the Unix family.
Available It is available in multiple languages. It is available in English.
in
Kernel It is monolithic. It can be microkernel, monolithic,
Type and hybrid.
Written in C and other programming languages. C and assembly language.
File system It supports more file systems than Unix It also supports less than Linux
support like ext2, ext3,ext4, jfs, xfs, btrfs etc. like jfs, gpfs, hfs, ufs zfs etc.
Usage It is used in several systems like Unix is majorly used on
desktop, smartphones, mainframes and workstations and servers.
servers.
Examples Some examples of Linux are: Fedora, Some examples of unix are IBM
Debian, Red Hat, Ubuntu, Android, AIX, Darwin, Solaris, HP-UX,
etc. macOS X, etc.
Security Linux provides higher security. Unix is also highly secured.
Price Linux is free and its corporate support Unix is not totally free. There are
is available at a price. some Unix versions that are free,
other than that UNIX is expensive.
Portable Linux is portable which can be Unix is not portable.
executed on different hard drives.
Default BASH is the default shell for Linux Bourne shell is the default shell for
shell Unix
Thread Fast Takes time
detection
Limitations • Standard edition of Linux is not • User Interface is not
available. friendly.
• Difficult to operate for new • Slow system performance.
users. • Files get destroyed with
• Many Windows-only programs typing mistakes.
can only be run on Linux with • Because the versions on
the help of a complex emulator. different machines differ
As an example. Microsoft Office slightly, there is a lack of
is a program that allows you to consistency.
create documents. • It does not support real time
• Linux has less reliable driver response time systems.
support, which can cause the
entire system to fail.
2. Linux vs Windows
Features Linux Windows
Open/Closed Linux is Open-source OS Windows is not Open-source OS.
source
Price It is free of cost. It is costly.
Case- It is case-sensitive. It is not case-sensitive
sensitive
Kernel type In Linux, monolithic kernel is used. Here, micro kernel is used.
Efficiency It is more efficient in comparison of It is less efficient.
windows.
Path Here, forward slash is used for Here, back slash is used for
Separator separating the directories. separating the directories.
Security Linux is more secure than Windows. Less secure than Linux.
Support Linux is widely used in hacking While windows does not provide
hacking purpose-based systems. much efficiency in hacking.
Naming Naming convention is case-sensitive In Windows, it is not allowed for
Conventions in Linux. Like, Hello and hello are two files to have same name in the
two different files in Linux. same folder.
Development By Linus Torvalds in 1991 By Microsoft Corporation in 1985
Usability Complicated installation procedure Easy to operate but takes time to
but can handle complex tasks easily. install.
Peripherals Peripherals (printers and keyboards) Peripherals (printers & keyboards)
are considered as files. are considered devices.
Written in C and Assembly Language C++ and Assembly Language
Reliable Highly reliable and secure Not more reliable and secure
_______________________________________________________________
Steps to install Ubuntu WSL on Windows 10/11: -
1. Open Microsoft Store in your PCs and search for “Ubuntu” in the search bar
there.
5. Select the checkbox “Windows Subsystem for Linux” and “Virtual Machine
Platform” and then “OK”.
6. After applying all the changes, hit “Restart now” to finish the process.
7. Now, After Downloading the “Ubuntu”, click on “Open”.
8. It’ll take some time to unpack the distro.
Using this link, click on “WSL2 Linux kernel update package for x64
machines”, given on the page.
Question bank: -
1. What do you mean by operating system. Explain Linux.
2. Explain features of Linux.
3. Explain architecture/structure of Linux.
4. Explain login and logout in Linux. Which particular commands are used for this
purpose?
5. How to add a new user in Linux Environment?
6. How to restart and shutdown the Linux?
7. What are the various types of environment in Linux?
8. Distinguish between following:
i) Linux and Unix
ii) Linux and Windows
9. What is meant by distribution of Linux? Explain various distributions of Linux in
detail? How are the distributions created?
10.Which components of Linux structure acts as an interpreter?
11.Explain various types of shells?
12.How to identify the default type of shell used?
13.How to get the list of all supported shells by the system?
14.Distinguish between multi-tasking and multi-programming.
15.Distinguish between stand-alone, time-sharing and client-server environment.