OS Lab Manual
OS Lab Manual
To suggest more improvements and corrections please feel free to email to fatima.rida55@gmail.com. All rights are
reserved by the author. Manufactured in Pakistan. Except as permitted under the Pakistan States Copyright Act of
1971, no part of this report may be reproduced or distributed in any form or by any means, or stored in a database or
retrieval system, without the prior written consent of the author (fatima.rida55@gmail.com) including, but not limited
to, network or other electronic storage or transmission, or broadcast for distance learning.
LAB 1(Introduction to Operating System)
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!
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:
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------