Вы находитесь на странице: 1из 25

CIT 333 – Operating System 

LEARNING OBJECTIVES 
 
1. Computer System Structures 
 
What is an Operating System 
It is a software that works as an interface between a user and the computer hardware. The 
primary objective of an operating system is to make computer system convenient to use 
and to utilize computer hardware in an efficient manner. The operating system performs 
the basic tasks such as receiving input from the keyboard, processing instructions and 
sending output to the screen. 
 
1.1. Describe the general operations of computer 
Input:​ Information and programs are entered into the computer through Input devices 
such as the keyboard, disks, or through other computers via network connections or 
modems connected to the Internet. 
Processing:​ Computers have the innate ability to process data using a central processing 
unit (CPU). Also known as the processor, this device is the brain of the PC. 
CPUs perform two basic types of tasks: arithmetic operations and logical operations. 
Arithmetic operations involve basic math like addition and subtraction, while logical 
operations compare two numbers. 
Output:​ Output Devices displays information on the screen (monitor) or the printer and 
sends information to other computers 
 
1.2. Describe interrupts 
An interrupt is a function of an operating system that provides multi-process 
multi-tasking. The interrupt is a signal that prompts the operating system to stop 
work on one process and start work on another. 
 
1.3. Identify different I/O devices 
Input Devices 
The devices which are used to give data and instructions to the computer are called Input 
Devices.  
 
Keyboard:​ It is the most commonly used input device. It is used to enter data and instructions 
directly into the computer. 
Mouse:​ Mouse is another input device which is commonly found connected with the 
computers. It is basically a pointing device which works on the principle of Point and Click. 
Scanner:​ We can store pictures, photographs, diagrams into the computer with the help of 
scanner. The scanner reads the image and saves it in the computer as a file. 
Microphone:​ This is an input device which is used to record sound or voice into the computer 
system. You can store voice data in the computer by speaking in front of this device. 
 
Output Devices 
The devices which are used to display the results or information are called Output Devices. 
 
Monitor:​ This is the most common output device connected with the computer to display the 
processed information. 
The two commonly used monitor types are: 
● Cathode Ray Tube(CRT)Monitor 
● Liquid crystal Display(LCD)Monitor 
Printer:​ This is an important output device of the computer system. It gives a printed output of 
the results that appears on the monitor screen. 
Speaker: ​Speakers are categorised as output devices. These are used to listen to the music and 
sounds played by the computer. 
 
1.4. Describe the structure of input/output system 
 
1.5. Describe different storage devices 
Hard Disk 
A hard disk drive (HDD) is a non-volatile computer storage device containing 
magnetic disks or platters rotating at high speeds. It is a secondary storage device 
used to store data permanently. 
SSD 
A storage device containing non-volatile flash memory, used in place of a hard disk because 
of its much greater speed. 
Floppy Disk 
A floppy disk is a magnetic storage medium for computer systems. The floppy disk is 
composed of a thin, flexible magnetic disk sealed in a square plastic carrier. 
USB 
small external flash drive that can be used with any computer that has a USB port. 
CD 
A small plastic disc on which music or other digital information is stored in the form of a 
pattern of metal-coated pits from which it can be read using laser light reflected off the 
disc. 
DVD 
A type of compact disc able to store large amounts of data, especially high-resolution 
audiovisual material. 
 
1.6. Explain the hierarchy of storage devices 
1.7. Identify the protection issues encountered in a computer system 
1.8. Describe protection methods of computer operation 
 
2. Operating System Structures 
 
2.1. List functions of an operating system 
● Managing Resources 
● Providing User Interface 
● Running Applications 
● Support for built-in Utility Programs 
● Control Computer Hardware 
 
2.2. Describe the functions of an operating system 
● Managing Resources:​ Programs that manage the resources of a computer such as 
the printer, mouse, keyboard, memory and monitor. 
● Providing User Interface:​ Graphical user interface (GUI) is something developers 
create to allow users to easily click something without having to understand how or 
why they clicked an icon. Each icon on a desktop represents code linking to the spot 
in which the icon represents. It makes it very easy for uneducated users. 
● Running Applications,​ is the ability to run an application such as Word processor 
by locating it and loading it into the primary memory. Most operating systems can 
multitask by running many applications at once. 
● Support for built-in Utility Programs:​ This is the program that find and fixes 
errors in the operating system. 
● Control Computer Hardware:​ All programs that need computer hardware must go 
through the operating system which can be accessed through the BIOS (basic input 
output system) or the device drivers. 
 
2.3. Explain memory management techniques. 
● Segmentation 
Segmentation refers to the technique of dividing the physical memory space into multiple 
blocks. Each block has specific length and is known as a segment. 
● Paging 
Paging is a technique in which the main memory of computer system is organized in the 
form of equal sized blocks called pages. 
● Swapping 
Swapping is the technique used by an operating system for efficient management of 
memory space of a computer system. Swapping involves performing two tasks called 
swapping in and swapping out. 
 
2.4. Describe virtual memory 
Virtual Memory is a storage allocation scheme in which secondary memory can be 
addressed as though it were part of main memory. 
 
2.5. Describe hierachical directory system. 
2.6. Describe UNIX file system 
Unix file system is a logical method of organizing and storing large amounts of information 
in a way that makes it easy to manage. A file is a smallest unit in which the information is 
stored. Unix file system has several important features. All data in Unix is organized into 
files. All files are organized into directories. These directories are organized into a tree-like 
structure called the file system. 
 
Files in Unix System are organized into multi-level hierarchy structure known as a directory 
tree. At the very top of the file system is a directory called “root” which is represented by a 
“/”. All other files are “descendants” of root. 
 

 
 
2.7. Explain disk management system 
The operating system is responsible for several aspects of disk management. 
 
Disk Formatting  
A new magnetic disk is a blank slate: it is just a platter of a magnetic recording  
material. Before a disk can store data, it must be divided into sectors that the  
disk controller can read and write. This process is called low-level formatting or physical 
formatting 
 
Boot Block 
An area of a disk having information for loading the operating system that is needed to 
start a computer. 
 
Bad Block 
A bad block is an area of storage media that is no longer reliable for storing and retrieving 
data because it has been physically damaged or corrupted. Bad blocks are also referred to 
as bad sectors. 
 
2.8. Explain how the operating system manages the resources of a computer 
2.9. Enumerate OS services and explain the service 
● User interface​ - Almost all operating systems have a user interface (UI). 
Varies between Command-Line (CLI), Graphics User Interface (GUI), 
Batch 
● Program execution​ - The system must be able to load a program into  
memory and to run that program, end execution, either normally or  
abnormally (indicating error) 
● I/O operations​ - A running program may require I/O, which may involve a  
file or an I/O device 
● File-system manipulation​ - The file system is of particular interest. 
Programs need to read and write files and directories, create and delete  
them, search them, list file Information, permission management. 
● Communications​ – Processes may exchange information, on the  
same computer or between computers over a network 
Communications may be via shared memory or through  
message passing (packets moved by the OS) 
● Error detection​ – OS needs to be constantly aware of possible  
errors 
May occur in the CPU and memory hardware, in I/O devices, in  
user program 
For each type of error, OS should take the appropriate action to 
ensure correct and consistent computing 
Debugging facilities can greatly enhance the user’s and  
programmer’s abilities to efficiently use the system 
● Resource allocation​ - When multiple users or multiple jobs running  
concurrently, resources must be allocated to each of them 
Many types of resources - Some (such as CPU cycles, main memory,  
and file storage) may have special allocation code, others (such as I/O  
devices) may have general request and release code 
● Accounting​ - To keep track of which users use how much and what kinds  
of computer resources 
● Protection and security​ - The owners of information stored in a multiuser  
or networked computer system may want to control use of that information,  
concurrent processes should not interfere with each other 
● ​Protection​ involves ensuring that all access to system resources is  
controlled 
● ​Security​ of the system from outsiders requires user authentication,  
extends to defending external I/O devices from invalid access attempts 
If a system is to be protected and secure, precautions must be  
instituted throughout it. A chain is only as strong as its weakest link. 
 
2.10. Define system calls 
In computing, a system call is the programmatic way in which a computer program 
requests a service from the kernel of the operating system it is executed on. This may 
include hardware-related services, creation and execution of new processes, and 
communication with integral kernel services such as process scheduling. 
 
2.11. Identify system programs that come with the operating system 
There are several kind of system programs that come with O.S. 
● File management 
● Status information 
● File modification 
● Programming-language support 
● Program loading and execution 
● Communications 
 
2.12. Describe the functions of these system programs 
System programs that come with the operating system provide a convenient environment 
for program  
development and execution. The can be divided into: 
 
File management​ - Create, delete, copy, rename, print, dump, list,  
and generally manipulate files and directories 
Status information 
● Some ask the system for info - date, time, amount of available  
memory, disk space, number of users 
● Others provide detailed performance, logging, and debugging information 
● Typically, these programs format and print the output to the terminal or other 
output devices 
● Some systems implement a registry - used to store and retrieve configuration 
information 
File modification 
● Text editors to create and modify files 
● Special commands to search contents of files or perform  
transformations of the text 
Programming-language support​ - Compilers, assemblers,  
debuggers and interpreters sometimes provided 
Program loading and execution​- Absolute loaders, relocatable 
loaders, linkage editors, and overlay-loaders, debugging systems for  
higher-level and machine language 
Communications​ - Provide the mechanism for creating virtual  
connections among processes, users, and computer systems 
● Allow users to send messages to one another’s screens, browse web pages, send 
electronic-mail messages, log in remotely, transfer files from one machine to 
another 
 
2.13. Describe the general structure and architecture of an operating system 
For efficient performance and implementation an OS should be partitioned into separate 
subsystems, each with carefully defined tasks, inputs, outputs, and performance 
characteristics. These subsystems can then be arranged in various architectural 
configurations: 
 
Simple Structure 
When DOS was originally written its developers had no idea how big and important it 
would eventually become. It was written by a few programmers in a relatively short 
amount of time, without the benefit of modern software engineering techniques, and then 
gradually grew over time to exceed its original expectations. It does not break the system 
into subsystems, and has no distinction between user and kernel modes, allowing all 
programs direct access to the underlying hardware. ( Note that user versus kernel mode 
was not supported by the 8088 chip set anyway, so that really wasn't an option back then. 

 
 
The original UNIX OS used a simple layered approach, but almost all the OS was in one big 
layer, not really breaking the OS down into layered subsystems: 
 
 
 
2.14. Illustrate the structure by diagrams 
 

 
 
 
 
 
2.15. Discuss design goals of the operating system 
Short 
At the highest level, system design is dominated by the choice of hardware and system 
type. 
 
Beyond this level, the requirements can be divided into two groups: user goals, and system 
goals. 
● User goals include convenience, reliability, security, and speed. 
● System goals include ease of design, implementation, maintenance, flexibility, and 
efficiency. 
Long 
Concurrent Systems 
Modern operating systems should be able to handle multiple users as well as multiple 
devices at the same time. This is necessary for the modern multi-core architectures. 
Because of these specifications, the operating system design can be quite complex and 
difficult to create. 
 
Security and Privacy 
Operating systems should be able to provide security and privacy for a system. This is very 
important as there are many malicious users who may want to hack into the computer 
system and steal user programs. 
 
Resource Sharing 
The operating system should make sure that resources are shared in a correct manner 
between multiple user processes. This can get quite complex when multiple users share 
the same device as well. 
 
Future Hardware and Software Changes 
A major design consideration is that the operating system should be able to weather future 
hardware and software changes and not become obsolete. This is necessary as the 
operating system being changed again and again is quite a costly process. 
 
Portable Operating Systems 
The operating systems should be portable i.e. they should work with different hardware 
and machines. There may be some speciality operating system that only work on one kind 
of machine, however, most of them are portable. 
 
Backward Compatibility 
The new operating systems created should be compatible with the previous models i.e. 
they should contain backward compatibility. 
 
No Specific Type of Users 
Operating systems should be developed keeping in mind a general user base so that many 
users can use them. Even specially developed operating systems that target a single user 
base contain generality. 
 
3. Unix/Linux Implementation 
 
3.1. Discuss the development of Unix/Linux development 
Unix 
Unix is a family of multitasking, multiuser computer operating systems that derive from the 
original AT&T Unix, development starting in the 1970s at the Bell Labs research center by 
Ken Thompson, Dennis Ritchie, and others. 
Linux 
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an 
operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is 
typically packaged in a Linux distribution 
Like: Ubuntu, Fedora, Debian & so on. 
 
3.2. Explain the design principles of Unix/Linux 
3.3. Log in and log out in the system 
When you want to log in locally using a text-only terminal, you will see the prompt: 
 
​login: 
 
At this prompt, type in your username and press the enter/return/ key. Remember that 
UNIX is case sensitive (i.e. Will, WILL and will are all different logins). You should then be 
prompted for your password: 
 
​login: will  
​password: 
 
Type your password in at the prompt and press the enter/return/ key. Note that your 
password will not be displayed on the screen as you type it in. 
 
If you mistype your username or password you will get an appropriate message from the 
computer and you will be presented with the login: prompt again. Otherwise you should be 
presented with a shell prompt which looks something like this: 
 
​$ 
 
To log out of a text-based UNIX shell, type "exit" at the shell prompt (or if that doesn't work 
try "logout"; if that doesn't work press ctrl-d). 
 
3.4. Configure the user own environment  
3.5. Change and manage own password 
One of the things you should do when you log in for the first time is to change your 
password. 
The UNIX/LINUX command to change your password is passwd: 
 
​ $ passwd 
 
The system will prompt you for your old password, then for your new password. To 
eliminate any possible typing errors you have made in your new password, it will ask you to 
reconfirm your new password. 
 
3.6. Use Unix/Linux help system (Manual System) 
man​ command in Linux is used to display the user manual of any command that we can 
run on the terminal. It provides a detailed view of the command 
 
Syntax : 
 
$man [OPTION]... [COMMAND NAME]... 
 
3.7. Characterize Unix/Linux file system and its organization 
3.8. Name correctly file and directory 
3.9. Create and delete files and directories 
Create Files 
The touch command creates a new empty file. 
 
$ touch filename 
 
To create multiple empty files use the touch commands with the file names in one line as 
shown below. 
 
$ touch file1 file2 file3 
 
Create Directories 
The mkdir command creates new directories. 
 
$ mkdir directory_name 
 
Include the –p option if the directory name includes a path name. 
 
$ mkdir -p directory_names 
 
Delete Files 
To delete a single file use, the rm command followed by the file name: 
 
$ rm filename 
 
To delete multiple files at once use the rm command followed by the file names separated 
by space. 
 
$ rm file1 file2 file3 
 
Delete Directories (Folders) 
To remove an empty directory use the -d option. 
 
$ rm -d dirname 
 
To remove non-empty directories and all the files within them, use the r (recursive) option. 
 
rm -r dirname 
 
3.10. Set the permissions of files and directories 
 
Command line: File permissions 
The commands for modifying file permissions and ownership are: 
 
● chmod – change permissions 
 
● chown – change ownership. 
 
4. Unix/Linux Basic Commands 
 
4.1. Invoke correctly Unix/Linux commands used in user and user-determination and 
file search 
 
 
4.2. Invoke correctly Unix/Linux commands used in administration of own 
environment and  
process-related job 
4.3. Use correctly Unix/Linux commands to manipulate files and directories 
Working with directories 
 
● pwd: ​pwd command (Print Working Directory) displays your current directory. 
 
usman@debian8:~$ pwd 
/home/paul 
 
● cd:​ You can change your current directory with the cd command (Change Directory). 
 
usman@debian8$ cd /etc 
usman@debian8$ pwd 
/etc 
 
 
● ls:​ You can list the contents of a directory with ls. 
 
usman@debian8:~$ ls 
allfiles.txt dmesg.txt services stuff summer.txt 
 
● Create Directories 
The mkdir command creates new directories. 
 
$ mkdir directory_name 
 
Include the –p option if the directory name includes a path name. 
 
$ mkdir -p directory_names 
 
● Delete Directories (Folders) 
To remove an empty directory use the -d option. 
 
$ rm -d dirname 
 
To remove non-empty directories and all the files within them, use the r (recursive) option. 
 
rm -r dirname 
 
Working with files 
 
● Create Files 
The touch command creates a new empty file. 
 
$ touch filename 
 
To create multiple empty files use the touch commands with the file names in one line as 
shown below. 
 
$ touch file1 file2 file3 
 
● Delete Files 
To delete a single file use, the rm command followed by the file name: 
 
$ rm filename 
 
To delete multiple files at once use the rm command followed by the file names separated 
by space.  
 
$ rm file1 file2 file3 
 
● cp:​ To copy a file, use cp with a source and a target argument.  
 
$ cp file42 file42.copy 
 
If the target is a directory, then the source files are copied to that target directory. 
 
$ cp file42 dir42 
 
● mv:​ Use mv to rename a file or to move the file to another directory. 
 
$ mv file42 file33 
 
 
4.4. Use correctly Unix/Linux commands to search and view at contents of files 
Search Files by Name or Extension 
 
Use find from the command line to locate a specific file by name or extension. The 
following example searches for *.err files in the /home/username/ directory and all 
sub-directories: 
find /home/username/ -name "*.err" 
 
View Contents of Files 
 
● head:​ You can use head to display the first ten lines of a file. The basic syntax of 
head command is: 
 
$ head [options] [file(s)] 
 
The head command can also display the first n lines of a file. 
 
Example: 
 
$ head -4 /etc/passwd 
 
● tail: S ​ imilar to head, the tail command will display the last ten lines of a file. 
 
$ tail [options] [file(s)] 
 
You can give tail the number of lines you want to see.  
 
Example: 
 
$ tail -4 /etc/passwd 
 
● cat:​ The ‘cat‘ command is most widely used, universal tool. It copies standard input 
to standard output. The command supports scrolling, if text file doesn’t fit the 
current screen.. 
 
The most common use of cat is to read the contents of files 
 
$ cat file42 
 
cat is short for concatenate. One of the basic uses of cat is to concatenate files into a bigger 
(or complete) file. 
 
$ cat file1 file2 file3 
$ cat file1 file2 file3 > file4 
 
You can use cat to create flat text files. Type the cat > winter.txt 
 
$ cat > winter.txt 
 
● more & less:​ The more command is useful for displaying files that take up more 
than one screen. More will allow you to see the contents of the file page by page. 
Use the space bar to see the next page, or q to quit. Some people prefer the less 
command to more. 
 
● strings:​ With the strings command you can display readable ascii strings found in 
(binary) files. 
 
4.5. Print files using Unix/Linux commands 
'pr' command 
This command helps in formatting the file for printing on the terminal. There are many 
options available with this command which help in making desired format changes on file. 
The most used 'pr' options are listed below.   
 
 
-x 
Divides the data into 'x' columns 
-h "header" 
Assigns "header" value as the report header 
-t 
Does not print the header and top/bottom margins 
-d 
Double spaces the output file 
-n 
Denotes all line with numbers 
-l​ page length 
Defines the lines (page length) in a page. Default is 56 
-o​ margin 
Formats the page by the margin number 
 
 
Printing a file 
 
Once you are done with the formatting, and it is time for you to get a hard copy of the file, 
you need to use the following command: 
 
lp Filename 
 
or 
 
lpr Filename 
 
4.6. Use correctly Unix/Linux scheduling commands 
 
$ crontab 
 
Syntax: 
 
crontab [-u user] [file] 
 
crontab [-u user] -l | -r [-i] | -e 
 
DESCRIPTION 
 
● Crontab is the program used to install, deinstall or list the tables used to drive the 
cron daemon for running commands on a repeating schedule. 
 
● The first usage is to install a schedule of commands from a file or from standard 
input. If no options are specified, it reads from standard input. 
 
-u user 
Specify which user’s schedule to adjust (only for root). The default is for your own account. 
 
-l 
List the currently scheduled commands 
 
-r 
Remove the currently scheduled commands 
 
-i 
Prompt the user to confirm removal of the scheduled commands 
 
-e 
Edit the list of scheduled commands. After saving the temporary file and exiting from the 
editor, the commands entered in the file are scheduled. The default editor used is vi. If you 
wish to use another editor, such as nano, set your EDITOR environment variable: 
 
$ at 
 
Syntax: 
 
at -r job | -l | TIME 
 
DESCRIPTION 
 
The at command is used to schedule a command to run one time. 
 
-r job 
Remove scheduled jobs, identified by their job number. This is the same as running atrm 
job 
 
-l 
List the scheduled jobs 
 
TIME 
TIME is a very flexible specification of when the command should run. See the text book for 
examples. at then reads from standard input for list of commands to run at this time. Type 
the EOF character (Cntrl-d) when finished entering commands. 
 
4.7. Use correctly Unix/Linux storage and status commands 
Storage Check Command 
On Unix-like operating systems, the df command reports the amount of available disk 
space being used by file systems. 
 
Syntax: 
 
df [OPTION]... [FILE]... 
 
-a, --all 
Include dummy file systems. 
-B, --block-size=SIZE 
Scale sizes by SIZE before printing them. E.g., '-BM' prints sizes in units of 1,048,576 bytes. 
See "SIZE Format" below for more information. 
--total 
Display a grand total. 
-h, --human-readable 
Print sizes in human readable format (e.g., 1K 234M 2G). 
-H, --si 
Same as -h, but use powers of 1000 instead of 1024. 
-i, --inodes 
List inode information instead of block usage. 
-k 
Like --block-size=1K. 
-l, --local 
Limit listing to local file systems. 
--no-sync 
Do not invoke a sync before getting usage info, which is the default setting. 
-P, --portability 
Use the POSIX output format. 
--sync 
Invoke a sync before getting usage info. 
-t, --type=TYPE 
Limit listing to file systems of type TYPE. 
-T, --print-type 
Print file system type. 
-x, --exclude-type=TYPE 
Limit listing to file systems not of type TYPE. 
-v 
Ignored; included for compatibility reasons. 
--help 
Display a help message and exit. 
--version 
Output version information and exit. 
 
4.8. Invoke correctly text processing command 
head​ -- display first lines of a file 
tail ​-- display the last part of a file 
cat​ -- concatenate and print files 
less​ – paged output, with support to move forward and backward 
cut​ -- cut out selected portions of each line of a file 
sort​ -- sort lines of text files 
uniq -​ - report or filter out repeated lines in a file 
paste​ -- merge corresponding or subsequent lines of files 
join​ -- relational database operator 
diff​ -- compare files line by line 
awk​ -- pattern-directed scanning and processing language 
grep​ -- print lines matching a pattern 
find​ -- display lines beginning with a given string 
wc​ -- word, line, character, and byte count 
tr​ -- translate characters 
sed​ -- stream editor 
 
4.9. Use other miscellaneous commands available to Unix/Linux 
 
5. Text Processing 
 
What is vi editor 
The VI editor is the most popular and classic text editor in the Linux family. 
● It is available in almost all Linux Distributions 
● Nowadays, there are advanced versions of the vi editor available, and the most 
popular one is VIM which is Vi Improved. 
 
5.1. Invoke vi editor 
 
To launch the VI Editor Open the Terminal (CLI) and type 
 
vi <filename_NEW> or <filename_EXISTING> 
 
&If you specify an existing file, then the editor would open it for you to edit. Else, you can 
create a new file. 
5.2. Compose text using vi editor 
To compose text in vi editor we have following commands: 
 
To Start vi 
vi filename Create or Edit filename starting at line 1 
 
Inserting or Adding text 
i Insert text before cursor,until<esc>hit 
I Insert text at beginning of current line,until<esc>hit 
a Append text after cursor,until<esc>hit 
A Append text to end of current line,until<esc>hit 
o Open and put text in a new line below current line,until<esc>hit 
O Open and put text in a new line above current line,until<esc>hit 
 
Changing the text  
r Replace single character under cursor(no needed) 
R Replace characters,starting with current cursor position 
cw Change the current word with new text,starting with the character under cursor 
cNw Change N words beginning with the character under cursor 
c change(replace)the characters in the current line 
cc change(replace)the characters in the current line,stopping when hit 
 
Deleting the text 
x Delete single character under cursor 
Nx Delete N characters, starting with character under cursor 
dw Delete the single word beginning with character under cursor 
dNw Delete N words beginning with character under cursor 
D Delete the remainder of the line,starting with current cursor position 
dd Delete entire current line 
Ndd or dNd Delete N lines beginning with the current line 
 
Cutting and pasting the text 
yy Copy (yank,cut) the current line into buffer 
Nyy or yNy copy(yank,cut) the next N lines,including the current line, into the buffer 
p put(paste) the lines in the buffer into the text after the current line 
 
Moving within a file 
You need to be in the command mode to move within a file. The default keys for navigation 
are mentioned below else; You can also use the arrow keys on the keyboard. 
 
k Move cursor up 
j Move cursor down 
h Move cursor left 
l Move cursor right 
 
Saving and Closing the file 
You should be in the command mode to exit the editor and save changes to the file. 
 
Shift+zz Save the file and quit 
:w Save the file but keep it open 
:q Quit without saving 
:wq Save the file and quit 
 
5.3. Describe different mode of vi editor 
There are two following modes of vi editor: 
 
Command mode: 
● The vi editor opens in this mode, and it only understands commands. 
● In this mode, you can, move the cursor and cut, copy, paste the text. 
● This mode also saves the changes you have made to the file. 
● Commands are case sensitive. You should use the right letter case. 
 
Insert mode: 
● This mode is for inserting text in the file. 
● You can switch to the Insert mode from the command mode by pressing 'i' on the 
keyboard 
● Once you are in Insert mode, any key would be taken as an input for the file on 
which you are currently working. 
● To return to the command mode and save the changes you have made you need to 
press the Esc key 
 
6. Unix/Linux Shells 
 
6.1. Define Unix/Linux shells 
A shell is a program that provides an interface between a user and an operating system 
(OS) kernel. An OS starts a shell for each user when the user logs in or opens a terminal or 
console window. 
 
What is a Kernel 
A kernel is a central component of an operating system. It acts as an interface  
between the user applications and the hardware. The sole aim of the kernel is to  
manage the communication between the software (user level applications) and the  
hardware (CPU, disk memory etc). The main tasks of the kernel are : 
● Process management 
● Device management 
● Memory management 
● Interrupt handling 
● I/O communication 
● File system...etc.. 
 
6.2. Explain the functions of shell 
Using functions to perform repetitive tasks is an excellent way to create code reuse. This is 
an important part of modern object-oriented programming principles. 
 
Shell functions are similar to subroutines, procedures, and functions in other programming 
languages. 
 
Creating Functions 
To declare a function, simply use the following syntax −  
function_name () {  
list of commands 

 
6.3. Describe Bourne Shell of Unix/Linux 
Bourne shell (sh) is a UNIX shell or command processor that is used for scripting. It was 
developed in 1977 by Stephen Bourne of AT&T and introduced in UNIX Version 7, replacing 
the Mashey shell (sh). 
 
6.4. Use Bourne shell in Unix/Linux 
 
7. System Administration 
 
7.1. Describe Unix/Linux system administration 
7.2. Describe tasks of Unix/Linux system administration 
7.3. Identify hardware requirements of Unix/Linux system 
Ubuntu Desktop Edition: 
 
2 GHz dual core processor 
2 GiB RAM (system memory) 
25 GB of hard-drive space (or USB stick, memory card or external drive but see LiveCD for 
an alternative approach) 
VGA capable of 1024x768 screen resolution 
Either a CD/DVD drive or a USB port for the installer media 
Internet access is helpful 
 
7.4. Plan and Install Unix/Linux 
Installation of Linux: 
 
● Download the Linux distribution of your choice. ... 
● Boot into the Live CD or Live USB. ... 
● Try out the Linux distribution before installing. ... 
● Start the installation process. ... 
● Create a username and password. ... 
● Set up the partition. ... 
● Boot into Linux. ... 
● Check your hardware. 
● Start using Linux. 
 
7.5. Start up and shutdown Unix/Linux 
7.6. Add and maintain new users in the system 
Creating User Accounts 
The procedure for creating a new user account is always the same (in principle) 
and consists of the following steps: 
● You must create entries in the /etc/passwd (and possibly /etc/shadow) files. 
● If necessary, an entry (or several) in the /etc/group file is necessary. 
● You must create the home directory, copy a basic set of files into it, and transfer 
ownership of the lot to the new user. 
 
Syntax: 
 
useradd [⟨options⟩] ⟨user name⟩ 
 
The passwd Command 
The passwd command is used to set up passwords for users. If you are logged in as 
root, then 
 
# passwd joe 
 
● asks for a new password for user john (You must enter it twice as it will not be 
echoed to the screen). 
● The passwd command is also available to normal users, to let them change their 
● own passwords (changing other users’ passwords is root’s prerogative) 
 
Deleting User Accounts 
● To delete a user account, you need to remove the user’s entries from /etc/passwd 
and 
● /etc/shadow, delete all references to that user in /etc/group, and remove the user’s 
● home directory as well as all other files created or owned by that user. 
 
userdel [-r] ⟨user name⟩ 
 
Changing User Accounts and Group Assignment 
User accounts and group assignments are traditionally changed by editing the 
/etc/passwd and /etc/group files. 
 
usermod -g ⟨group⟩ ⟨user name⟩ 
 
7.7. Set permission to users 
7.8. Manage and repair file systems 
7.9. Create file systems 
7.10. Describe Unix/Linux system basic accounting  
7.11. Set up accounting system in Unix/Linux 
7.12. Describe performance monitoring in Unix/Linux 
7.13. Use tools for monitoring performance of the system 
7.14. Describe services facility provided by Unix/Linux 
7.15. Describe device administrative tasks 
7.16. Install printer to Unix/Linux system 
Step 1: Open printer settings. Go to the Dash. ... 
Step 2: Add new printer. Click Add. 
Step 3: Authentications. Under Devices > Network Printer select Windows Printer via 
Samba. ... 
Step 4: Choose driver. ... 
Step 5: Select .PPD file. ... 
Step 6: Choose driver. ... 
Step 7: installable options. ... 
Step 8: Describe printer. 
STEP 9: Properties 
STEP 10: Printer options 
● Set Paper Size to A4. 
● Set Input Slot to Tray 3. 
● Set 2-sided print to 2-sided Print, Flip on Long Edge. 
● Click OK. 
 
You are now ready to print. 
 
7.17. Describe email facility of Unix/Linux 
7.18. Describe mail transfer agents 
7.19. Explain UUCP and FTP services 
UUCP 
Unix-to-Unix copy (UUCP) is a set of computer programs and protocols that allow for the 
remote execution of commands and the transfer of email and files between computers. 
FTP 
The File Transfer Protocol (FTP) is a standard network protocol used for the transfer of 
computer files between a client and server on a computer network. 
 
7.20. Describe FTP protocol 
7.21. Setup and administer FTP services 
7.22. Explain purpose of backup 
7.23. Back -up and restore Unix/Linux system 
 

Вам также может понравиться