Lab 01
Lab 01
Lab Manual 01
Introduction of Operating system
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!
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!
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:
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------