0% found this document useful (0 votes)
26 views11 pages

Lab 01

its my lab notes

Uploaded by

Muhammad Waseem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views11 pages

Lab 01

its my lab notes

Uploaded by

Muhammad Waseem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

The Islamia University of Bahawalpur

Lab Manual 01
Introduction of Operating system

Operating Systems Lab


LAB 1(Introduction to Operating System)

What is an Operating System?


Each time you power up your computer, you encounter a display offering various functions
such as writing, internet browsing, or video watching. What facilitates this functionality
within the computer hardware? How does the processor discern your request to play an
MP3 file?

Essentially, this task is managed by the operating system, or more specifically, the kernel.
The kernel serves as the core program within any operating system, responsible for
facilitating essential functions such as enabling hardware to interact with software. Thus,
for your computer to function, it requires an Operating System (OS), which you're currently
utilizing as you peruse this text on your computer. While you might be familiar with
mainstream OS options like Windows or Apple OS X, let's delve into understanding Linux
and the advantages it presents over other OS alternatives!

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
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 take 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.

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.
It is an easy to use and a good alternative to
Opens MS windows. It can be easily set up andcan
USE 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
desktop Distribution. It aims at being a
Slackware 'Unix like' OS with minimal changes to its
kernel.

This is the third most popular desktop


operating system after Microsoft Windows
and Apple Mac OS. It is based on the
Ubuntu Debian Linux Distribution and it is known
for its desktop environment.
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
including varieties of computers and big than Linux. It is mostly available for desktop
range of mobile phones, tablet PC and PC, laptops and some Windows mobile
mainframes. phones
2. Basic version of Linux is available free of 2. Windows version price starts from $50
cost while you have to pay for updated to $450. In short, paid packages of
and latest version. Windows are more expensive than Linux.
3. Linux is open source software. 3. Windows is closed source software.
4. Because Linux is an open source 4. While Windows OS takes 2 to 3 month
software so whenever a user’s faces a for correction of reported threat and error
threat or problem he reports the same and after that releases new patches and
on community discussion form and updates.
developers starts to finding the
solution.
5. Red Hat, Android and Debian are 5. Windows XP, Vista, 7, 8 and 8.1 are
examples of Linux OS. examples of Windows OS.
6. While games compatible range in Linux 6. If you are a game lover than most of the
is very low and less features are games are supportable by Windows.
available for games.
7. Torvalds is the developer of Linux. 7. Microsoft is developing the Windows.
8. Graphical Derivers less available for 8. Most of the driver’s manufactures are
Linux. providing lot of compatible graphics drivers
9. Linux OS is most secure than Windows for Windows
OS. Until now, 150 viruses have been 9. Which are very less than 70,000 viruses
reported to Linux. reported to Windows.
10. But, in Linux, files are ordered in a tree 10. In Microsoft Windows, files are stored in
structure starting with the root folders under different data drives like C: D:
directory. E:
11. In Linux and UNIX, everything is a file. 11. In Windows, you cannot have 2 files
Directories are files, files are files, and with the same name in the same folder.
devices like Printer, mouse, keyboard
etc. are files.
12. In Linux you would find the system and 12. In Windows, System and Program files
program files in different directories. are usually saved in C: drive.
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 "Ali". He can store his personal files and directories in
the directory "/home/Ali". 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/Ahmad" of another user account “Ahmad". 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