Lab 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

INTRODUCTION TO

OPERATING SYSTEM
Lab-01

Lab Instructor: Aneeza Alam

Student Name

Student Roll #

Department

Year/Section
LAB 1(Introduction to Operating System)

What is an Operating System?


Every time you switch on your computer, you see a screen where you can perform different
activities like write, browse the internet or watch a video. What is it that makes the computer
hardware work like that? How does the processor on your computer know that you are asking it
to run a mp3 file?
Well, it is the operating system or the kernel which does this work. A kernel is the program at the
heart of any operating system that takes care of fundamental stuff, like letting hardware
communicate with software. So, to work on your computer you need an Operating System (OS).
In fact, you are using one as you read this on your computer. Now, you may have used popular
OS's like Windows, Apple OS X but here we will learn what Linux is and what benefits it offers
over other OS choices…!

What is Linux? Who created Linux?


Linux is an operating system or a kernel which germinated as an idea in the mind of young and
bright Linus Torvalds when he was a computer science student. He used to work on the UNIX
OS proprietary software), and thought that it needed improvements…
However, when his suggestions were rejected by the designers of UNIX, he thought of launching
an OS which will be receptive to changes, modifications suggested by its users…
The Lone Kernel & the early days…
So Linus devised a Kernel named Linux in 1991.Though he would need programs like File
Manager, Document Editors, and Audio-Video programs to run on it. Something as you have a
cone but no ice-cream on top…
As time passed by, he collaborated with other programmers in places like MIT and applications
for Linux started to appear. So around 1991, a working Linux operating system with some
applications was officially launched and this was the start of one of the most loved and open-
source OS options available today…
The earlier versions of Linux were not so user friendly as they were in use by computer
programmers and Linus Torvalds never had it in mind to commercialize his product…
This definitely restricted the Linux's popularity as other commercially oriented Operating System
Windows got famous. However, the open-source aspect of the Linux operating system made it more
robust…
Linux gets its due attention

Linux Distribution Name Description

This Linux Distro is popular amongst


Developers. It is an independently
Arch
developed system .It is designed for users
who go for a do-it-yourself approach…
It is one of the most used Linux
Distribution for enterprise and web
CentOS servers. It is a free enterprise class
Operating system and is based heavily on
Red Hat enterprise Distro…
Debian is a stable and popular non-
commercial Linux distribution. It is widely
Debian used as a desktop Linux Distro and is user-
oriented. It strictly acts within the Linux
protocols…
Another Linux kernel based Distro, Fedora
is supported by the Fedora project, an
Fedora endeavor by Red Hat. It is popular among
desktop users. Its versions are known for
their short life cycle.
It is a source based Distribution which
means that you need to configure the code
Gentoo on your system before you can install it. It
is not for Linux beginners, but it is sure
fun for experienced users.
It is one of the most popular Desktop
Distributions available out there. It
Linux
launched in 2006 and is now considered to
Mint
be the fourth most used Operating system
in the computing world.

Opens It is an easy to use and a good alternative


USE to MS windows. It can be easily set up and
can also run on small computers with
obsolete configurations.
Another popular enterprise based Linux
Red Hat Distribution is Red Hat
Enterprise.It has enterprise evolved from
Red Hat Red Hat Linux which was discontinued in
2004. It is a commercial Distro and very
popular among its
clientele.
Slackware is one of the oldest Linux
kernel based OS's. It is another easy
Slackware desktop Distribution. It aims at being a
'Unix like' OS with minimal changes to its
kernel.
This is the third most popular desktop
operating system after Microsoft Windows
Ubuntu and Apple Mac OS. It is based on the
Debian Linux Distribution and it is known
for its desktop environment.
The main advantage of Linux was that programmers were able to use the Linux Kernel in order to design
their own custom operating systems. With time, a new range of user-friendly OS's captured the computer
world. Now, Linux is one of most popular and widely used Kernel, and it is the backbone of popular
operating systems like Debian, Knoppix, Ubuntu, and Fedora. Nevertheless, the list does not end here as
there are thousands of OS's based on Linux which offer a variety of functions to the users.
The benefits of using Linux
Linux now enjoys popularity at its prime and it's famous among programmers as well as regular computer
users around the world. Its main benefits are -
It offers a free operating system. You do not have to shell hundreds of dollars to get the OS like
Windows!
Being open-source, anyone with programming knowledge can modify it…
The Linux operating systems now offer millions of programs/applications to choose from, most
of them free!
Once you have Linux installed you no longer need an antivirus! Linux is a highly secure system.
More so, there is a global development community constantly looking at ways to enhance its
security. With each upgrade, the OS becomes more secure and robust
Linux is the OS of choice for Server environments due to its stability and reliability (Mega-
companies like Amazon, Facebook, and Google use Linux for their Servers). A Linux based

server could run non-stop without a reboot for years on end. Is it for me?
Users, who are new to Linux, usually shun it by falsely considering it as a difficult and technical
OS to operate but, to state the truth, in the last few years Linux operating systems have become a
lot more user-friendly than their counterparts like Windows, so trying them is the best way to
know whether Linux suits you or not.
There are thousands of Linux based operating systems; most of them offer state-of-the-art
security and applications, all of it for free!

I am asked to Learn Unix? Then why Linux?


UNIX is called the mother of operating systems which laid out the foundation to Linux. UNIX is
designed mainly for mainframes and is in enterprises and universities While Linux is fast
becoming a household name for computer users, developers and server environment. You may
have to pay for a UNIX kernel while in Linux it is free.
But, the commands used on both the operating systems are usually the same. There is not much
difference between UNIX and Linux. Though they might seem different, at core, they are
essentially the same. Since, Linux is a clone of UNIX. So learning one is same as learning
another…
Selecting a Linux Distribution and Types of Installation
Now that we know what Linux is, it is time that to learn how we should install it on the computer and
choose which Distribution we should use. Let us start by understanding what a Linux Distribution is.

What is a Linux Distribution?


Well, now as you know that Linux is an open-source, free to use kernel. It is used by programmers,
organizations, profit and non-profit companies around the world in order to create Operating systems to
suit their individual requirements.
To prevent hacking attempts, many organizations keep their Linux operating systems private.
Many others, make their variations of Linux available publicly so the whole world can benefit at
large. These versions/ types /kinds of Linux operating system are called Distributions. There are
hundreds of Linux operating systems or Distributions available these days. Many of them are
designed with a specific purpose in mind. For example, to run a web server or to run on network
switches like routers, modems etc. The latest example of one of the most popular smartphone
based Linux Distribution is Android! Many of these Distributions are built to offer excellent
personal computing. Here, are a few popular Linux Distributions (also called Linux Distro) -

The Best Linux Distribution!


The term best is relative. Each Linux distribution is built for a specific purpose built to meet the
demands of its target users.
The desktop Distributions are available for free at their respective websites. You might want to
try them one by one till you get to know which Distribution you like the most. Each one of them
offers its own unique design, applications and security.
We will be using Ubuntu for our learning purpose as it's easy for a beginner to understand.

Windows Vs Linux Operating System


Windows is the first operating system of personal computers having graphical user interface,
which was initially released by Microsoft in 20 November 1985. It is available in 137
international languages, which is itself is written in C, C++ and Assembly languages. This
operating system is available for both professional and personal computers. You can use it to
many brands like HP, Dell, IBM, Sony and Toshiba. Moreover, Windows operating system is
also for many mobile companies like HTC, Nokia and Samsung.
Linux is a free open source operating system for computers, laptops and mobiles, which is
available since 1991. This operating system is very popular in mainframe and supercomputers. In
latest report of November 2014, 97% of top 500 super computers of world are using different
version of Linux. Personal computers, mobile devices, servers and super computers are its main
markets.
Basic Difference between Windows & Linux Operating systems
1. Linux is available for lot of devices 1. Windows is available for less devices than
including varieties of computers and big Linux. It is mostly available for desktop PC,
range of mobile phones, tablet PC and laptops and some Windows mobile phones
mainframes. 2. Windows version price starts from $50 to
2. Basic version of Linux is available free of $450. In short, paid packages of Windows are
cost while you have to pay for updated and more expensive than Linux.
latest version. 3. Windows is closed source software.
3. Linux is open source software. 4. While Windows OS takes 2 to 3 month for
4. Because Linux is an open source software correction of reported threat and error and
so whenever a user’s faces a threat or after that releases new patches and updates.
problem he report the same on community
discussion form and developers starts to 5. Windows XP, Vista, 7, 8 and 8.1 are
finding the solution. examples of Windows OS.
5. Red Hat, Android and Debian are 6. If you are a game lover than most of the
examples of Linux OS. games are supportable by Windows.
6. While games compatible range in Linux is
very low and less features are available for
7. Microsoft is developing the Windows.
games.
7. Torvalds is the developer of Linux.
8. Most of the drivers manufactures are
providing lot of compatible graphics
8. Graphical Derivers less available for drivers for Windows
Linux.
9. Which are very less than 70,000 viruses
reported to Windows.

9. Linux OS is most secure than Windows 10. In Microsoft Windows, files are stored in
OS. Until now, 150 viruses have been folders under different data drives like C:
reported to Linux. D: E:
10. But, in Linux, files are ordered in a tree 11. In Windows, you cannot have 2 files with
structure starting with the root directory. the same name in the same folder.

11. In Linux and UNIX, everything is a file.


Directories are files, files are files, and 12. In Windows, System and Program files are
devices like Printer, mouse, keyboard etc. usually saved in C: drive.
are files.
12. In Linux you would find the system and
program files in different directories. For
example, the boot files are stored in the
/boot directory and program and software
files can be found under /bin , device files
in /dev. Below are important Linux
Directories and short description of what
they contain.

Types of Files in Linux


General Files
General Files also called as Ordinary files. They can contain image, video, program or simply
text. They can be in ASCII or a Binary format. These are the most commonly used files by
Linux Users
Directory Files
These files are a warehouse for other file types. You can have a directory file within a directory
(sub-directory). You can take them as 'Folders' found in Windows operating system.
Device Files:
In Linux, these are represented as files. For example, if the first SATA (Serial attachment) hard
drive had three primary partitions, they would be named and numbered as /dev/sda1, /dev/sda2
and /dev/sda3.
Users IN Linux
Regular User
A regular user account is created for you when you install Ubuntu on your system. All your files
and folders are stored in /home/ which is your home directory. As a regular user, you do not
have access to directories of other users.
Root User
Other than your regular account another user account called root is created at the time of
installation. The root account is a super user who can access restricted files, install software and
has administrative privileges. Whenever you want to install software, make changes to system
files or perform any administrative task on Linux; you need to log in as a root user. Otherwise,
for general tasks like playing music and browsing the internet you can use your regular account.
Service user
Linux is widely used as a Server Operating System. Services such as Apache, mail, etc. have
their own individual service accounts. Having service accounts increases security of your
computer. Linux can allow or deny access to various resources depending on the service.
Name Convention in Linux
While in Linux, you can have 2 files with the same name in the same directory, provided
they use different cases.
For every user in Linux, a directory is created as /home/
Consider, a regular user account "Tom". He can store his personal files and directories in the
directory "/home/tom". He can't save files outside his user directory and does not have access to
directories of other users. For instance, he cannot access directory "/home/jerry" of another user
account “Jerry".
The concept is the similar to C:\Documents and Settings in Windows.

Directories in Linux:
• UNIX/ Linux has a hierarchical file system structure consisting of a root directory
(denoted as /) with other directories and files hanging under it.
• UNIX/ Linux uses a directory hierarchy that is commonly represented as folders.
• However, instead of using graphical folders typed commands (in a command line user
interface) are used to navigate the system.
• Particular files are then represented by paths and filenames much like they are in html
addresses.
• A pathname is the list of directories separated by slashes (/).
• If a pathname starts with a /, it refers to the root directory. The last component of a path
may be a file or a directory.
• A pathname may simply be a file or directory name. For example,
/usr/include/sys/prgm.h, ~/courses/cs604, and prog1.c are pathnames.
• When you log in, the system places you in a directory called your home directory (also
called login directory)
• Shells also understand both relative and absolute pathnames.
• An absolute pathname starts with the root directory (/) and a relative pathname starts with
your home directory, your current directory, or the parent of your current directory (the
directory that you are currently in).
• For example, /usr/include/sys/param.h is an absolute pathname and ~/courses/cs604 and
prog1.c are relative pathnames.
• Figures 4.5 and 4.6 show sample directory structures in a UNIX/Linux system. The user nadeem
has a subdirectory under his home directory, called courses. This directory contains
subdirectories for the courses that you have taken, including one for this course.

Directory Structure

Task to DO
1. Write here the types of Files and detail store in these directories.
/bin:
/boot:
/cdrom:
/dev:
/etc:
/ home:
/lib:
/Lost+found:
/media:
/mnt:
/opt:
/proc:
/root:
/run:
/sbin:
/selinux:
/srv:
/sys:
/tmp:
/usr:
/var:
---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------

You might also like