Linux Shell and Shell Scripting TCS 492 2024
Linux Shell and Shell Scripting TCS 492 2024
System services: In a monolithic kernel, all system services run in kernel space,
whereas in a microkernel, only the most basic services (such as memory
management and process scheduling) run in kernel space, with other services
running in user space.
Performance: Monolithic kernels are generally faster and more efficient than
microkernels, because there is no overhead associated with moving data
between kernel space and user space.
Modularity: Microkernels are more modular than monolithic kernels, because
services are separated into different processes running in user space. This
makes it easier to add or remove services without affecting other parts of the
system.
Security: Microkernels are generally considered more secure than monolithic
kernels, because a bug or vulnerability in a service running in user space is less
likely to affect the entire system.
Development: Developing a monolithic kernel is generally simpler and faster
than developing a microkernel, because all system services are integrated and
share the same memory space.
Linux Shell Terminologies
• If you are using any major operating system you
are indirectly interacting to shell.
• Three Important terminologies –
–Kernel
–Shell
–Terminal
Linux Kernel
• The Linux kernel has found its way into an incredible
number of diverse systems. It can now be found in
everything from automobiles to rockets, watches to
televisions, and netbooks to the fastest
supercomputers.
• Linux only accounts for a relatively small percentage of
the operating systems found on desktop computers,
but has gained widespread use in servers, Internet of
Things (IoT) devices, networking equipment,
smartphones, and many other devices you may not
think of as even being computers.
• From the home router providing your Internet
connection to the server this course is hosted on, it is
likely that multiple Linux powered devices are currently
enabling you to read this page.
What is 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 manages following resources of the Linux
system –
– File management
– Process management
– I/O management
– Memory management
– Device management etc.
Complete Linux system = Kernel
+ GNU system utilities and
libraries + other management
scripts + installation scripts.
GNU stands for “GNU's Not Unix”
What is Shell
• A shell is special user program which provide
an interface to user to use operating system
services.
• 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.
Types of Shell
• Shell is broadly classified into two categories –
–Command Line Shell
–Graphical shell
Types of Shell
There are several shells are available for Linux
systems like
• BASH (Bourne Again SHell) – It is most widely used
shell in Linux systems. It is used as default login
shell in Linux systems and in macOS. It can also be
installed on Windows OS.
• CSH (C SHell) – The C shell’s syntax and usage are
very similar to the C programming language.
• KSH (Korn SHell) – The Korn Shell also was the base
for the POSIX Shell standard specifications etc.
Each shell does the same job but understand
different commands and provide different built in
functions.
To check which is your current shell
Shell Scripting
• Usually shells are interactive that mean, they
accept command as input from users and execute
them. However some time we want to execute a
bunch of commands routinely, so that we need
not have to type all commands each time in
terminal.