UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Operating Systems
Experiment 1
Introduction and Installation of LINUX
CLO 2. Use modern tools and languages.
CLO 3. Demonstrate an original solution of problem under
discussion.
CLO 4. Work individually as well as in teams
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Introduction to Linux
Operating System
System software that allows users or the application programs they are
using to interact with the computer hardware in an easy and convenient
manner.
Major functions of an operating system:
1. It creates a virtual machine interface between the user/application program
and the hardware.
2. It acts as the computer’s resource manager or resource allocator.
3. It functions as the program launcher.
Two parts of an operating system:
1. Kernel
2. Shell
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
What is Linux?
Linux is an operating system. (We will conduct our labs on Linux environment
and we will use Ubuntu for this purpose)
Why Linux?
✓ LINUX is free.
✓ Can view and edit the source code of OS.
✓ It is fully customizable.
✓ Most Important Feature is Stability
✓ LINUX has better security structure.
✓ Written in C which is highly portable.
Layers in Linux:
Three important parts of Linux are Kernel, Shell and File system.
Kernel:
✓ The kernel is a computer program that is the core of a computer’s
operating system, with complete control over everything in the
system.
✓ It is the low-level core of the System that is the interface between
applications and H/W.
✓ Functions are to Manage Memory, I/O devices, allocates the time
between user and process, inter process communication, sets process
priority.
Shell:
✓ Shell is special user program which provide an interface to user to
act as an interface between users and kernel to use operating system
services.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
✓ Shell accept human readable commands from user and convert them
into something which kernel can understand.
✓ It is a command language interpreter that execute commands read
from input devices such as keyboards or from files. The shell gets
started when the user logs in or start the terminal.
File System:
✓ Linux treats everything as a file including hardware devices. Arranged
as a directory hierarchy.
✓ The top-level directory is known as “root (/)”.
Terminal:
The traditional Unix environment is a CLI (command line interface), where
you type commands to tell the computer what to do.
Virtual Box
• Installed on an existing host OS.
• Guest OS can be loaded and run, each with its own virtual environment.
• Supported host operating systems.
• Linux Mac OS X, Windows XP, Windows Vista, Windows 7, Solaris.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
VitualBox running an Ubuntu 18 VM
Linux Installation
a. Perform installation of Ubantu Linux Environment on your Laptops.
b. It’s already installed on PCs.
c. Note all the steps in the demo for installation from Lab Supervisor.
Basic Shell Commands
1. cd command in Linux with Examples
cd command in linux known as change directory command.
It is used to change current working directory.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Syntax:
$ cd [directory]
To move inside a subdirectory
to move inside a subdirectory in linux we use
$ cd [directory_name]
In the above example, we have checked number of directories in our home
directory using “ls” command
Then moved inside the Documents directory by using cd Documents command.
Different functionalities of cd command:
cd /
This command is used to change directory to the root directory.
the root directory is the first directory in your filesystem hierarchy.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
$ cd /
Above, “/” represents the root directory.
cd dir_1/dir_2/dir_3
This command is used to move inside a directory from a
directory
This is called a “Relative Path”
$ cd dir_1/dir_2/dir_3
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
In above example, we have the document directory and inside the
document directory we have a directory named geeksforgeeks and inside that
directory we have example directory.
To navigate example directory we have used command “cd
Documents/geeksforgeeks/example”. which is called the ‘Relative Path”.
cd ~
this command is used to change directory to the home directory.
$ cd ~
or
$ cd commad also work same as cd ~ command.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
cd ..
this command is used to move to the parent directory of current
directory
or the directory one level up from the current directory.
“..” represents parent directory.
$ cd ..
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
cd “dir name”
This command is used to navigate to a directory with white spaces.
Instead of using double quotes we can use single quotes then also
this command will work.
$ cd "dir name"
In above example, we have navigated the My songs directory by using
cd “My songs” command.
or
$ cd dir\ name
this command work same as cd “dir name” command.
UNIVERSITY OF ENGINEERING AND TECHNOLOGY,
TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Task:
1. Open Terminal in Ubuntu to Run shell commands
2. Make Directory using mkdir Command, Change directories using cd
Command, check current working directory using pwd Command.