OS Lab 1

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

OPERATING SYSTEM LAB

LAB REPORT : 01

Name: Ghullam Mustafa

Roll No: 11669

Section: BSSE-4th B

Submitted To : Sir Aqib Adeel

Dated: 19th Feb, 2019


1
LINUX
Just like Windows XP, Windows 7, Windows 8, and Mac OS X, Linux is an operating system. An operating
system is software that manages all of the hardware resources associated with your desktop or laptop. To put
it simply – the operating system manages the communication between your software and your hardware.
Without the operating system (often referred to as the “OS”), the software wouldn’t function.

The OS is comprised of a number of pieces:

 The Bootloader: The software that manages the boot process of your computer. For most users, this
will simply be a splash screen that pops up and eventually goes away to boot into the operating
system.

 The kernel: This is the one piece of the whole that is actually called “Linux”. The kernel is the core
of the system and manages the CPU, memory, and peripheral devices. The kernel is the “lowest”
level of the OS.

 Daemons: These are background services (printing, sound, scheduling, etc) that either start up
during boot, or after you log into the desktop.

 The Shell: You’ve probably heard mention of the Linux command line. This is the shell – a
command process that allows you to control the computer via commands typed into a text interface.
This is what, at one time, scared people away from Linux the most (assuming they had to learn a
seemingly archaic command line structure to make Linux work). This is no longer the case. With
modern desktop Linux, there is no need to ever touch the command line.

 Graphical Server: This is the sub-system that displays the graphics on your monitor. It is
commonly referred to as the X server or just “X”.

 Applications: Desktop environments do not offer the full array of apps. Just like Windows and Mac,
Linux offers thousands upon thousands of high-quality software titles that can be easily found and
installed. Most modern Linux distributions (more on this in a moment) include App Store-like tools
that centralize and simplify application installation. For example: Ubuntu Linux has the Ubuntu
Software Center (Figure 1) which allows you to quickly search among the thousands of apps and
install them from one centralized location.

2
Advantages of Linux over Windows

Why Linux is better than Windows. Some of the points mentioned here

1. Open Source Nature

What is it like when you buy a car, but you cannot see what’s under the hood? Similar is
the case with when you use a Windows-powered system.

However, in contrast, Linux is completely an open source project. You can have a look at the
source code of a Linux OS, which is a plus.

2. Secure
Let’s face it; Windows OS is vulnerable to different types of attacks (or hacks). However,
Linux is not as vulnerable as Windows. It sure isn’t invulnerable, but it is a lot more secure.
Although, there’s no rocket science in it.

It is just the way Linux works that makes it a secure operating system. Overall, the process
of package management, the concept of repositories, and a couple more features makes it
possible for Linux to be more secure than Windows.

When you have Windows installed, you need to download/p urchase an Antivirus
program to keep your computer safe from hackers and malware. However, Linux does not
require the use of such Anti -Virus programs.

3. Can revive older computers


As the operating systems evolve, so do their hardware requirements increase exponentially.
For instance, if you purchase a genuine copy of Windows 10, you will have to meet the
minimum hardware requirements to run it successfully, and you cannot run it on just about
any low-end system.

Nevertheless, with Linux, you could even utilize one of your oldest computer systems to
achieve a task. However, that does not mean that every Linux distribution would work
with 256 MB of RAM coupled with an outdated processor. However, there are options which
you can install on such low-end systems as well (such as Puppy Linux).

So, being an efficient OS, Linux distributions could be fitted to a range of systems (low -
end or high-end). In contrast, Windows operating system has a higher hardware requirement.

3
4. Perfect For Programmers
Linux supports almost all of the major programming languages ( Python, C/C++, Java,
Perl, Ruby, etc.). Moreover, it offers a vast range of applications useful for programming
purposes.

The Linux terminal is superior to use over Window’s command line for developers. You
would find many libraries developed natively for Linux. Also, a lot of programmers point out
that the package manager on Linux helps them get things done easily.

5. Software Updates
Microsoft pushes a software update when it receives a set of problems or if something
major needs to be fixed. On the other hand, you would observe a software update to address a
little problem.

So, with Linux, you will notice more updates to fix the problems you might be facing. You
will not only encounter a larger number of software updates, but you will also observe much
faster software updates.

6. Customization
One major advantage of using Linux instead of Windows is customization. If you like
tweaking your system’s looks, Linux is just perfect for you.

Apart from installing themes, you have tons of beautiful icon themes. In addition to that,
you can use Conky to display system information on the desktop in the coolest way possible.
Needless to say that you can do a lot around Wallpapers in Linux.

4
7. Free to Use
Linux is accessible to the public for free! However, that is not the case with Windows!

You will not have to pay 100-250 USD to get your hands on a genuine copy of a Linux
distro (such as Ubuntu, Fedora). So, it is entirely free.

If something is free but useful, it is always the best thing one could expect. With the
money you just saved, you can consider enhancing your system.

8. Better Community Support

You do not need to hire an expert to solve a problem you are facing on your Linux system.
You just need to search for a similar thread on the web for a solution or post a thread to let
others solve the problem. Within minutes of posting a thread on any of the Linux forums, you
may expect a reply along with a detailed solution which would finally help resolve your
problem at no cost.

File System In LINUX

Disk storage is a necessity that brings with it some interesting and inescapable details. Obviously, a
filesystem is designed to provide space for non-volatile storage of data; that is its ultimate function.
However, there are many other important functions that flow from that requirement. All filesystems need to
provide a namespace—that is, a naming and organizational methodology. This defines how a file can be
named, specifically the length of a filename and the subset of characters that can be used for filenames out
of the total set of characters available. It also defines the logical structure of the data on a disk, such as the
use of directories for organizing files instead of just lumping them all together in a single, huge
conglomeration of files. File systems also require an Application Programming Interface (API) that provides
access to system function calls which manipulate file system objects like files and directories. APIs provide
for tasks such as creating, moving, and deleting files. It also provides algorithms that determine things like
where a file is placed on a file system. Such algorithms may account for objectives such as speed or
minimizing disk fragmentation.

5
Directory

As a usually very organized Virgo, I like things stored in smaller, organized groups rather than in one
big bucket. The use of directories helps me to be able to store and then locate the files I want when I am
looking for them. Directories are also known as folders because they can be thought of as folders in which
files are kept in a sort of physical desktop analogy.

In Linux and many other operating systems, directories can be structured in a tree-like hierarchy. The
Linux directory structure is well defined and documented in the Linux Filesystem Hierarchy
Standard (FHS).

Directory Discription

/ (root filesystem) The root filesystem is the top-level directory of the filesystem. It must contain
all of the files required to boot the Linux system before other filesystems are
mounted. It must include all of the required executables and libraries required to
boot the remaining filesystems. After the system is booted, all other filesystems
are mounted on standard, well-defined mount points as subdirectories of the
root filesystem.

/bin The /bin directory contains user executable files.

/boot Contains the static bootloader and kernel executable and configuration files
required to boot a Linux computer.

/dev This directory contains the device files for every hardware device attached to
the system. These are not device drivers, rather they are files that represent each
device on the computer and facilitate access to those devices.

Etc Contains the local system configuration files for the host computer.

Home Home directory storage for user files. Each user has a subdirectory in /home.

Lib Contains shared library files that are required to boot the system.

6
media A place to mount external removable media devices such as USB thumb drives
that may be connected to the host.

Mnt A temporary mountpoint for regular filesystems (as in not removable media)
that can be used while the administrator is repairing or working on a filesystem.

Sbin System binary files. These are executables used for system administration.

Tmp Temporary directory. Used by the operating system and many programs to store
temporary files. Users may also store files here temporarily. Note that files
stored here may be deleted at any time without prior notice.

Usr These are shareable, read-only files, including executable binaries and libraries,
man files, and other types of documentation.

Commands

1. Exit

The exit command lets you quit the shell where it's run.If your shell window has multiple
tabs, then this command exits the tab where it's executed. Given that it's a built-in command, it's
highly likely that you won't find a dedicated man page for exit.
2. Pwd
The pwd tool prints the name of the present/current working directory (PWD -Present Working
Directory, got it?). Following is its syntax:
Syantax: pwd [OPTION]...
3. Cd

The cd command is used to change the current directory (i.e., the directory in which the user is
currently working) in Linux and other Unix-like operating systems. It is similar to the CD and
CHDIR commands in MS-DOS.
cd's syntax is:
cd [option] [directory]
The items in square brackets are optional. When used without specifying any directory name,
cd returns the user to the previous current directory. This provides a convenient means of toggling
between two directories.

7
4. Clear
Clear clears your screen if this is possible. It looks in the environment for the terminal type
and then in the terminfo database to figure out how to clear the screen. clear ignores any command-
line parameters that may be present.
5. Touch
It is used to create a file without any content. The file created using touch command is empty.
This command can be used when the user doesn’t have data to store at the time of file creation.
Syntax:
touch File1_name File2_name File3_name

6. Mkdir
command in Linux allows the user to create directories (also referred to as folders in some
operating systems ). This command can create multiple directories at once as well as set the
permissions for the directories. It is important to note that the user executing this command must
have enough permissions to create a directory in the parent directory, or he/she may recieve a
‘permission denied’ error.

Syntax:
mkdir [options...] [directories ...]
7. Rmdir

The rmdir command removes each directory specified on the command line, if they are empty.
That is, each directory removed must contain no files or directories, or it cannot be removed
by rmdir.
If any specified directory is not empty, rmdir will not remove it, and will proceed to try and
remove any other directories you specified.
8. Cp
The cp command is makes copies of files and directories.
Syntax

cp [option]... [-T] source destination

cp [option]... source... directory

You might also like