0% found this document useful (0 votes)
2 views7 pages

Cc Assignment 2

The document discusses shell scripting in Linux, explaining the concept of a shell as a command-line interface that interacts with the operating system. It outlines various types of shells, including Bourne Shell, Bash, C Shell, Korn Shell, Z Shell, and Fish Shell, each with unique features. Additionally, it includes practical assignments for writing shell scripts to check user permissions, install software, monitor disk usage, and back up a MySQL database.

Uploaded by

Jayesh Wakle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

Cc Assignment 2

The document discusses shell scripting in Linux, explaining the concept of a shell as a command-line interface that interacts with the operating system. It outlines various types of shells, including Bourne Shell, Bash, C Shell, Korn Shell, Z Shell, and Fish Shell, each with unique features. Additionally, it includes practical assignments for writing shell scripts to check user permissions, install software, monitor disk usage, and back up a MySQL database.

Uploaded by

Jayesh Wakle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Name:Jayesh

Wakle
PRN: 22210630
Roll no.: 322029
Div: B2 Assignmnet 2

Aim : Shell
Scripting

Īheory :
1. What is Shell? (Įinux Kernel Architecture Diagram)
In Įinux, a shell is a command-line interface (CĮI) program that allows
users to interact with the operating system by typing commands. It acts
as a bridge between the user and the operating system's core, known as
the kernel, by interpreting and executing commands.
Įinux Kernel Architecture Diagram:
Īhe Įinux kernel is the core part of the Įinux operating system. It
manages hardware resources and enables communication between
software and hardware components. A simplified diagram of the Įinux
kernel architecture typically includes the following layers:
 Hardware Įayer: Īhis represents the physical components of the
system, such as the CPU, memory, storage devices, and other
peripherals (like the keyboard and mouse).
 Kernel Space: Īhis is where the Įinux kernel operates. It includes
crucial components like process scheduling, memory management,
device drivers, file system management, and the system call
interface.
 User Space: Īhis is where user applications and processes run. It
includes programs, libraries, and utilities that interact with the
kernel to perform various tasks.
 Shell: Īhe shell is a user-level program within the user space
that lets users interact with the kernel. It interprets user
commands and executes them by making system calls to
the kernel.
 Utilities and Applications: Īhese are the programs and tools that
run in the user space and interact with the kernel to provide various
functionalities for the user.

2. Different Īypes of Shells


Įinux offers several types of shells, each with its own features, functionality, and
compatibility. Below are some of the most commonly used shells:
 Bourne Shell (sh): Developed by Stephen Bourne, the Bourne Shell
is one of the earliest Unix shells. It provides basic command-line
features and scripting capabilities. While lightweight and efficient,
it lacks the advanced features available in modern shells.
 Bourne Again Shell (bash): Bash was created to replace the
Bourne Shell and is the default shell for most Įinux
distributions. It’s backward
compatible with the Bourne Shell and offers extra features such as
command-line editing, history, aliases, and job control. It’s widely
used and supports advanced scripting with features like loops,
conditional statements, and functions.
 C Shell (csh): Developed at the University of California, Berkeley, the
C Shell has a C-like syntax and supports interactive command-line
editing. It offers features like aliases, history, and job control.
However, it’s less commonly used compared to Bash.
 Korn Shell (ksh): Created by David Korn at Bell Įabs, the Korn
Shell is an enhanced version of the Bourne Shell. It adds
advanced scripting capabilities, such as command-line editing,
history, and arithmetic expressions. Ksh is frequently used in
commercial environments.
 Z Shell (zsh): Īhe Z Shell is an advanced, improved version of Bash.
It offers additional features like advanced tab completion, spelling
correction, and customizable prompts. Zsh is highly customizable,
making it popular among developers and power users.
 Fish Shell (fish): Īhe Fish Shell is designed to be user-friendly, with
features like syntax highlighting, autosuggestions, and an intuitive
scripting syntax. It focuses on providing an easy-to-use and
interactive command-line experience. While not POSIX-compliant
like other shells, Fish offers a modern interface for users.

2a) Write a shell script to check user is root user or not [HINĪ:
study "id" command in linux]
Shell Script and Output

2b) Write a shell script to install any particular software (ex: java or
python) Shell Script
Output

2c) Write a shell script to check disk usage of the system and if disk
usage is more than 90% it should send an email to system admin. Īhis
script should run everyday at 8:00 AM.
Shell Script and Crontab
2d) write a shell script to take mysql database server backup. Īhis
script should run weekly on every sunday at 11:00 PM.

Shell Script and Crontab


Conclusion : In this, we learned how shell scripting can be used to
automate tasks on a Įinux system, helping us improve efficiency and
save time. Īhrough hands-on assignments, we gained valuable
experience in writing scripts to perform common system
administration tasks, like managing files, configuring software,
and monitoring system performance.

You might also like