0% found this document useful (0 votes)
18 views

OS LAB 2 - Copy1

This document provides an overview of the Linux operating system. It discusses that Linux is a popular open-source version of UNIX that is free to use. The key components of Linux include the kernel, system libraries, system utilities, and shells. It also describes Linux modes, features, file structure, directory structure, basic commands, and the booting process.

Uploaded by

lovely person
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

OS LAB 2 - Copy1

This document provides an overview of the Linux operating system. It discusses that Linux is a popular open-source version of UNIX that is free to use. The key components of Linux include the kernel, system libraries, system utilities, and shells. It also describes Linux modes, features, file structure, directory structure, basic commands, and the booting process.

Uploaded by

lovely person
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 30

OPERATING SYSTEM

AJAZ KHAN BAIG

Class : BSSE SEMESTER 4


Credit Hours ( 3+1)
LAB 2
Contents
Linux
Linux short history
File structure/ directory
Components
Linux architecture
Linux modes
Linux features
Shell and basic command s of shells
Window file system

3
What is Unix?
A multi-task and multi-user Operating System
Developed in 1969 at AT&T’s Bell Labs by
Ken Thompson (Unix)
Dennis Ritchie (C)
Douglas Mcllroy (Pipes - Do one thing, do it well)

Some other variants: System V, Solaris, SCO Unix,


SunOS, 4.4BSD, FreeBSD, NetBSD, OpenBSD, BSDI
4
What is Linux?
A clone (duplicate, replica, carbon copy) of Unix
Developed in 1991 by Linus Torvalds, a graduate student
Inspired by and replacement of Minix
Linus' Minix became Linux
Consist of  Linux Kernel 
GNU (GNU is Not Unix) Software 
Software Package management  etc
Originally developed for 32-bit x86-based PC
Ported to other architectures,

Slides = 31 5
linux
Popular version of UNIX operating System

It is open source as its source code is freely available.

It is free to use.

6
Components of Linux System
Kernel
Kernel is the core part of Linux.
responsible for all major activities of this operating system.
it interacts directly with the underlying hardware
System Library
System libraries are special functions or programs using which
application programs or system utilities accesses Kernel's features.
do not requires kernel module's code access rights.
System Utility
System Utility programs are responsible to do specialized, individual
level tasks.
7
8
Linux Modes
Kernel Mode
 Kernel component code executes in a special privileged mode called kernel
mode with full access to all resources of the computer.
 Single process, executes in single address space and do not require any
context switch
 Very efficient and fast.
 provides protected access to hardware to processes.

User Mode
 No accessto system hardware and kernel code.
 User programs and other system programs works in User Mode
 User programs/ utilities use System libraries to access Kernel functions

9
 Portable:
Linux Features
 Linux kernel and application programs support their installation on any kind of
hardware platform.
 Open Source
 Linux source code is freely available

 Multi-User
 multiple users can access system resources

 Multiprogramming
 multiple applications can run at same time.

 Hierarchical File System


 standard file structure in which system files/ user files are arranged.

 Shell ----Like DOS in windows


 Security
 provides user security using authentication features like password protection/

controlled access to specific files/ encryption of data.


10
Linux Architecture
Hardware layer –
Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc.).
Kernel –
Core component of Operating System, interacts directly with hardware,
provides low level services to upper layer components.
Shell –
An interface to kernel, hiding complexity of kernel's functions from
users. Takes commands from user and executes kernel's functions.
Utilities –
 Utility programs giving user most of the functionalities of an operating
systems. 11
Linux Architecture

12
Linux File System
• In Linux all directories are attached to the root
directory, which is identified by a forward-slash, "/". -
root.

• For example, below are some second-level directories:

13
• /bin  System binaries, including the • /proc  Kernel-processes pseudo file-
command shell system
• /boot  Boot-up routines • /root  Administrator’s home directory
• /dev  Device files • /sbin  System administration binaries
• /etc  System configuration files • /usr  User-oriented software
• /home  User directories • /var  Various other files: mail,
spooling and logging
• /lib  Shared libraries and modules
• /mnt  Mounted file-systems
• /lost+found  Lost-cluster files, recovered
from a disk-check • /opt  Optional software
`

14
Directory Structure
 A hierarchal file system structure

 At top a ROOT (/) directory with other directories and files hanging under
it

 When a user logged in, he/she is placed in his/her HOME (~) directory

/ students

ali … kamran … mohsin


bin dev home … sbin usr

personal … courses
faculty … students
15
CS401 … CS405
Computer storage
A binary system with
information stored as on
or off A kilobyte (KB)

A bit A megabyte (MB)

A byte A gigabyte (GB) …


16
Permanent storage
Disks – physical storage:
Hard disks
Floppy disks; CDs; Zip disks …

Disk Drives – input/output devices to the disks:


Hard drive
Floppy disk drive; Zip drive; CD drive or CD

read/writer …
17
Computer storage
Disk drives are referenced by using a letter
followed by a colon:
A: the floppy disk drive
C: the hard disk drive
Depending on the configuration of the computer:
D: or E: a CD drive or Zip drive
F: or greater a network drive
18
Directories/folders
Directories or folders are the key to
creating order on a disk

Directories can contain files and/or other


directories

19
The root directory
A root (or original) directory is automatically created for
each disk

The root is the start of the directory structure

It is referenced by a backward-leaning slash: \

For example, A:\ C:\ D:\


20
The hierarchical structure
As directories can hold other directories, the disks become
split into a hierarchy of directories

/ R o ot

M y D o c u m e n ts P ro g ra m F ile s W in d o w s N T

L e tte rs R e p o r ts C o n tr a c ts W o rd S P S S P ic t u r e s

2 00 1 2 0 0 2

21
Files
Types of file:
- program
- user-created
- executable

22
File suffixes
 .doc = Word

 .xls = Excel

 .htm(l) = Internet

 .pdf = Acrobat

 .ppt = PowerPoint

 .mdb = Access
23
Booting up Linux O.S.
After pressing POWER button, a code stored in ROM (read only
memory) will run called BIOS

BIOS has 02 basic functions to perform:


 Memory/ device detection and diagnostic checks
 Loading a bootstrap program from the boot disk into memory. Which will
eventually load the operating system

Some initial processes are created duringDaemon


bootstrapping in Linux
are the processes that run in background

e.g. "swapper", "init", "pagedaemon"


24
Shells
Shells in Linux are like Command Prompt in Window OS

Its purpose is to read and execute the user commands

Some famous shells in Linux are:


Bourne Shell (sh)
C Shell (csh)
Bourne Again Shell (bash)
TC Shell (tcsh)
Korn Shell (ksh)

25
Useful Commands
Display directory contents
$ ls
$ ls -a (Display all files in working directory)
$ ls –l (Listing/ Details)
Create Directory
$ mkdir directory_name
$ mkdir ~/courses/cs509
 Press ‘tab’ key and see how it helps you during specifying a path
Delete Directory
$ rmdir courses
Change Directory [Working directory]
$ cd ~/courses/cs508

26
Basic Commands
Commands Commands

 ls show files in current position su switch user


 cd change directory passwd change password
 cp copy file or directory useradd create new user account
 mv move file or directory userdel delete user account
 rm remove file or directory mount mount file system
 pwd show current position umount unmount file system
 mkdir create directory df show disk space usage
 rmdir remove directory shutdown reboot or turn off machine
 less, more, cat display file contents

27
Useful Commands
Display Abs Path of Working Directory
$ pwd

Copy Files

$ cp ~/file1 ~/course/file2
Move File
$ mv ~/file1 ~/course/file2

Removing Files
$ rm file1
$ rm *.o
28
Useful Commands
For more commands visit following web contents:

http://linuxcommand.org/learning_the_shell.php
http://ss64.com/bash/
vic.gedris.org/Manual-ShellIntro/1.2/ShellIntro.pdf
http://www.pixelbeat.org/cmdline.html

29
Summary
In this LAB following topics were covered:
Linux history
Linux directory
Linux directory
Linux file systems
Linux commands

30

You might also like