Introduction and Overview-Getting Started: Chapter
Introduction and Overview-Getting Started: Chapter
Chapter- 1
Introduction and
OverviewGetting Started
Chapter Objectives
Definition of operating system and the services offered by it.
Types of operating system.
History of UNIX and Linux along with their features.
Recap.
Quiz.
like operating system, it is possible for two users to login at a time and this
capability of the OS makes it a multi user operating system. Some examples
of multi user operating systems are Linux, Unix, and Windows 2000.
Single tasking and Multi tasking Operating Systems: When a single
program is allowed to run at a time, the system is grouped under a single
tasking system, while in case the operating system allows the execution of
multiple tasks at one time, it is classified as a multitasking operating system.
Multitasking can be of two types namely, pre emptive or co operative. In pre
emptive multitasking, the operating system slices the CPU time and dedicates
one slot to each of the process. Unix like operating systems such as Solaris and
Linux support pre emptive multitasking. Cooperative multitasking is achieved
by relying on each process to give time to the other processes in a defined manner.
MS Windows prior to Windows 95 used to support cooperative multitasking.
UNIX and Windows 2000 are examples of multitasking systems.
Real time Operating System: It is a multitasking operating system that
aims at executing real time applications. Real time operating systems often
use specialized scheduling algorithms so that they can achieve a deterministic
nature of behavior. The main object of real time operating systems is their
quick and predictable response to events. They either have an event driven
or a time sharing design. Time sharing operating systems switch tasks based
on the clock interrupts while an event driven system switches between tasks
based on their priorities. DSP BIOS is an example for real time Operating
system.
Distributed Operating System: An operating system that manages a
group of independent computers and makes them appear like a single computer
is known as distributed operating system. The development of networked
computers that could be linked and communicate with each other, gave rise to
distributed computing. Distributed computations are carried out on more than
one machine. When computers in a group work in cooperation, they make a
distributed system.
Embedded System: The operating systems designed for being used in
embedded computer systems are known as embedded operating systems. They
are designed to operate on small machines like PDAs with less autonomy.
They are able to operate with a limited number of resources. They are very
compact and extremely efficient by design. Windows CE, Minix 3 and Free
BSD are some examples of embedded operating systems.
1.3.2 Linux
In 1991, Linus Torvalds began developing an operating system kernel, which
he named "Linux". This kernel could be combined with the FSF material and
other components to produce a freely modifiable and very useful operating
system. This book will term the kernel itself the "Linux kernel'' and an entire
combination as "Linux''. Note that many use the term "GNU/Linux'' instead
for this combination. Linux is not derived from UNIX source code, but its
interfaces are intentionally like UNIX. Therefore, UNIX lessons learned
generally apply to both, including information on security.
h. Linux also supports Microsoft NTFS, vfat and many other file systems.
See Linux kernel source tree Documentation/file system directory for list
of all supported file system.
i. You can find out what type of file systems currently mounted with mount
command:
$ mount
OR
$ cat /proc/mounts
A UNIX file system is a collection of files and directories stored. Each
file system is stored in a separate whole disk partition. The following are a few
of the file system:
a. / - Special file system that incorporates the files under several directories
including /dev, /sbin, /tmp etc
b. /usr - Stores application programs
c. /var - Stores log files, mails and other data
d. /tmp - Stores temporary files
1.6 Basic UNIX commands
a. ls --- lists your files
ls - l --- lists your files in 'long format', which contains lots of useful infor-
mation.
ls - a --- lists all files, including the ones whose filenames begin in a dot.
b. more filename --- shows the first part of a file, as much as will fit on one
screen.
c. emacs filename --- is an editor that lets you create and edit a file.
d. mv filename1 filename2 --- moves a file
e. cp filename1 filename2 --- copies a file
f. rm filename --- removes a file.
g. diff filename1 filename2 --- compares files, and shows where they differ
h. wc filename --- tells you how many lines, words and characters there are
in a file
i. chmod options filename --- change the read, write and execute permissions
on files.
j. File Compression
i. gzip filename --- compresses files, so that they take up much less
space.
ii. gunzip filename --- uncompresses files compressed by gzip.
iii. gzcat filename --- to look at a gzipped file without actually having to
gunzip it.
8 Linux
k. printing :
i. lpr filename --- print.
ii. lpq --- check out the printer queue.
iii. lprm jobnumber --- remove something from the printer queue.
Points to remember
An operating system is a resource manager that is useful to handle all the
available resources effectively and efficiently.
The following are the available types of operating systems:
Single user and Multi user operating systems
Single tasking and Multi tasking operating systems
Real time operating system and
Distributed operating system
Linux and UNIX are almost the same, except that Unix is commercial
in nature.
1.7 Quiz
1. What is the need for an operating system?
2. What are the types of operating system available?
3. How does RTOS differ from other operating systems?
4. Which one is a free ware UNIX or Linux?
5. Define a file system.
6. What does dev correspond to?
7. How to change the read, write and execute permissions on files?
Answers
1. It is acting as a resource manager. It enhances the utilization of available
resources and it makes the user more comfortable.
2. There are single user, multi user, single- tasking, multi tasking, real time
OS and distributed OS are available in the market.
3. RTOS is an operating system that works for real time system, i.e. logical
correctness of the operation within a deterministic deadline is mandatory
in that kind of systems.
4. Linux.
5. A UNIX file system is a collection of files and directories stored.
6. Dev refers to device files.
7. Chmod is the simplest way to change the file permissions. Chmod with
number followed for user, group and others will get the permissions
changed.
ooo
Linux/Unix CommandsAn In-depth Analysis 9
Chapter- 2
Linux/Unix Commands
An In-depth Analysis
Chapter Objectives
Understanding Shell.
Discuss directory commands.
Discuss all file related commands.
Recap.
Quiz.
And Shell is the area where user can play around with the commands and
script that has to be run. It can be called as an environment where user can type
and get response.
Table 2.1 summarizes the available types of shell in the market and along
with a brief description of each.
Table 2.1: Available shells in the market with a brief description
S.No. Name of Shell Description
1. Bourne Shell (bsh) This is the original Unix shell written by Steve
Bourne of Bell Labs. This Shell is not as ad-
vanced as other latest shells.
2. C Shell (csh) This Shell was written at University of Cali-
fornia, Berkeley. It provides C like language
support for writing scripts. So, it is called as
C Shell.
3. TC Shell (tcsh) This Shell is very advanced and all the fea-
tures of the C shell together with emacs style
editing of the command line is presented in
this Shell. It is available for public domain.
4. Korn Shell (ksh) David Korn of Bell labs has written the Shell.
This is made available in all Unix systems.
Combined features of C and TC shells along
with the features of Bourne shell are made
available in ksh. This is very advanced and
highly efficient shell. This is very interactive
in nature as well.
5. Bourne Again Shell This shell is written by free software founda-
(BASH) tion. GNU initiative helped in framing this out
totally. Bash is meant totally for the usage of
academic community and most of the Linux/
Unix users are using this shell. Bash provides
the features of all the previously mentioned
shells. It is in short a hybrid shell which com-
bined the features of all shells.