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

SLEUVA_os[1]

This document is a laboratory manual for the Operating System and Virtualization course for B.E. Semester IV in Information Technology. It includes practical outcomes, objectives for experiments, and detailed procedures for tasks such as installing Linux, using virtualization software, and executing shell scripts. The manual aims to provide hands-on experience and understanding of operating systems and their components.

Uploaded by

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

SLEUVA_os[1]

This document is a laboratory manual for the Operating System and Virtualization course for B.E. Semester IV in Information Technology. It includes practical outcomes, objectives for experiments, and detailed procedures for tasks such as installing Linux, using virtualization software, and executing shell scripts. The manual aims to provide hands-on experience and understanding of operating systems and their components.

Uploaded by

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

A Laboratory Manual for

Operating System and


Virtualization
(3141601)

B.E. Semester-IV
(Information Technology)

Directorate of Technical Education, Gandhinagar,


Gujarat

240163116010
Government Engineering College, Modasa

Certificate

This is to certify that Mr. LEUVA SAHIL M Enrollment


No.240163116010 of B.E. Semester 4th Information Technology of this
Institute (GTU Code:016) has satisfactorily completed the Practical work
for the subject Operating System and Virtualization (3141601) for
the academic year 2025.

Place:
Date:

Name and Sign of Faculty member

Head of the Department

240163116010
Operating System and Virtualizations (3141601)

Practical – Course Outcome matrix

Course Outcomes (COs):


CO-1: Learn and understand the concepts, core structure of Operating Systems and basic architectural
components involved in operating systems design.
CO-2: Understand the process management policies and scheduling of processes by CPU.
CO-3: Evaluate the requirement for process synchronization and coordination handled by operating system.
CO-4: Describe and analyze the memory management and its allocation policies.
CO-5: Analyze various device and resource management techniques for timesharing.
CO-6: Conceptualize the components involved in designing a contemporary Operating Systems.

Sr. No. Objective(s) of Experiment CO1 CO2 CO3 CO4 CO5

Study of Linux operating system, its variants and installation


1. √
of Linux Operating system
2. Installation of Linux Operating system as a Guest OS on √
Windows Operating system using virtualization software
3. Study of Basic commands of Linux/UNIX. √
Study of Advance commands and filters of Linux/UNIX.
4. √
Write a shell script to generate mark sheet of a student. Take
5. Three subjects, calculate and display total marks, percentage √
and Class obtained by the student.

Write a shell script to display multiplication table of given


6. √
number
7. Write a shell script to find factorial of given number n √
Write a shell script which will accept a number b and display
8. √
first n prime numbers as output.
Write a shell script which will generate first n fibonnacci
9. √
numbers like: 1, 1, 2, 3, 5, 13,18
Write a menu driven shell script which will print the
following menu and execute the given task.
a. Display calendar of current month
b. Display today’s date and time
10. √ √
c. Display usernames those are currently logged in the
system
d. Display your name at given x, y position
e. Display your terminal number

11. Write a shell script to read n numbers as command √


arguments and sort them in descending order
Write a shell script to display all executable files, directories
12. √
and zero sized files from current directory
Write a shell script to check entered string is palindrome or
13. √
not.

240163116010
14. Shell programming using filters (including grep, egrep, √
fgrep)

240163116010
Operating System and Virtualizations (3141601)

15. Study of Unix Shell and Environment Variables. √

16. Write a shell script to validate the entered date. (eg. Date √
format is : dd-mm-yyyy).
Write an awk program using function, which convert each
17. √
word in a given text into capital
Write a program for process creation using C. (Use of gcc
18. √
compiler)

19. Study about the virtual machine and virtualization √

Study about Hypervisors: VMWare ESXi , Microsoft


20. √
Hyper-V and Xen Server, and Java VM

240163116010
Operating System and Virtualizations (3141601)

Index

Page Date of Date of Sign. of


Sr. No. Objective(s) of Experiment
No. performance submission Teacher
Study of Linux operating system, its variants and
1.
installation of Linux Operating system
Installation of Linux Operating system as a Guest OS
2. on Windows Operating system using virtualization
software

3. Study of Basic commands of Linux/UNIX.

Study of Advance commands and filters of


4.
Linux/UNIX.
Write a shell script to generate mark sheet of a
5. student. Take Three subjects, calculate and display
total marks, percentage and Class obtained by the
student.
Write a shell script to display multiplication table of
6.
given number
Write a shell script to find factorial of given number
7.
n
Write a shell script which will accept a number b
8.
and display first n prime numbers as output.
Write a shell script which will generate first n
9.
Fibonacci numbers like: 1, 1, 2, 3, 5, 13,18
Write a menu driven shell script which will print the
following menu and execute the given task.
a. Display calendar of current month
b. Display today’s date and time
10.
c. Display usernames those are currently logged in
the system
d. Display your name at given x, y position
e. Display your terminal number
Write a shell script to read n numbers as command
11.
arguments and sort them in descending order
Write a shell script to display all executable files,
12. directories and zero sized files from current
directory
Write a shell script to check entered string is
13.
palindrome or not.
Shell programming using filters (including grep,
14.
egrep, fgrep)

15. Study of Unix Shell and Environment Variables.

240163116010
Write a shell script to validate the entered date. (eg.
16.
Date format is: dd-mm-yyyy).

240163116010
Operating System and Virtualizations (3141601)

Write an awk program using function, which


17.
convert each word in a given text into capital
Write a program for process creation using C. (Use
18.
of gcc compiler)

19. Study about the virtual machine and virtualization

Study about Hypervisors: VMWare ESXi, Microsoft


20.
Hyper-V and Xen Server, and Java VM

240163116010
Experiment No: 1

Aim: Study of Linux operating system, its variants and installation of Linux
Operating system

Date:

Relevant CO: Learn and understand the concepts, core structure of Operating Systems
and basic architectural components involved in operating systems design

Objectives:
To understand the foundational concepts of the Linux operating system.
To recognize and differentiate between various Linux distributions.
To gain hands-on experience in the installation process of Linux as the primary
OS.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
The Linux operating system is an open-source OS based on the UNIX architecture. It
was developed by Linus Torvalds in the early 1990s. The core of Linux, called the kernel,
interacts directly with the system hardware and provides services to the software
applications.

Linux is known for its flexibility, security, and adaptability. Over time, several
distributions (or 'distros') have evolved, each designed for specific use-cases. Some popular
Linux distributions include Ubuntu, Fedora, Delian, CentOS, and Red Hat.

Installation:

1. Selecting a suitable distribution.


2. Acquiring the installation media, usually an ISO file.
3. Creating a bootable USB or DVD.
4. Booting from the created media.
5. Following the installation instructions.

Procedure:

1. Select a Linux distribution: For beginners, Ubuntu or Fedora is often recommended due
to their user-friendly interfaces.

2. Download the ISO File: Go to the official website of your chosen distribution and
download the ISO file.

3. Create a Bootable Media: Use tools like 'Rufus' or 'UNetbootin' to create a bootable USB.

4. Insert the Bootable Media: Plug the USB drive into the computer you want to install
Linux on.

5. Reboot & Select Boot Media: Reboot the computer. During the startup, press the
boot menu key (usually F2, F10, or F12) and select the USB drive.
240163116010
6. Follow Installation Instructions: Once booted from the USB, you'll be guided through
various steps like partitioning the hard drive, setting the time zone, and creating a user
account.
7. Finish Installation: After all steps, Linux will be installed. Reboot the computer, and you
should boot into your new Linux OS.

Observations:
Step-1: Select a Linux distribution: we are using Ubuntu Linux System.

Step-2: Download the ISO Fil

240163116010
Step-3: Create/Insert a Bootable Media:

Step-4: Reboot & Select Boot Media:

240163116010
Step-5: Follow Installation Instructions:

1.

2.

Step-6: Finish Installation:


1.

240163116010
2.

Quiz:
1. Who developed the Linux operating system?
Answer: The Linux operating system was developed by Linus Torvalds in 1991.

2. Name any two popular distributions of Linux.


Answer: Two popular distributions of Linux are Ubuntu and Fedora.

3. What is the core of the Linux operating system called?


Answer: The core of the Linux operating system is called the Linux kernel.

4. Why do we need to create a bootable USB or DVD for the installation of Linux?
Answer: Creating a bootable USB or DVD is necessary for Linux installation because it
allows the computer to boot from the external media and initiate the installation process
without needing an already functioning operating system on the computer's hard drive.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 2

Aim: Installation of Linux Operating System as a Guest OS on Windows


Operating System using virtualization software.

Date:

Relevant CO: Learn and understand the concepts, core structure of Operating Systems
and basic architectural components involved in operating systems design

Objectives:
To comprehend the principle of virtualization and its significance in modern
computing.
To differentiate between Host and Guest operating systems.
To master the process of setting up virtualization software on Windows.
To successfully install and run Linux as a guest OS inside a virtualized
environment.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
Virtualization refers to the act of creating a virtual version of something, including
but not limited to a virtual computer hardware platform, operating system (OS), storage
device, or network resources. By using virtualization software, one can run multiple
operating systems on a single physical computer. In this context, the system on which you're
running the virtualization software (Windows in this case) is known as the Host OS, and the
OS you're installing inside the virtualized environment is called the Guest OS.

One popular virtualization software is Virtual Box, which allows users to create and
manage virtual machines. These virtual machines can run various operating systems,
providing a sandboxed environment that operates independently of the host system.

Procedure:
1. Download & Install Virtualization Software: Download Oracle Virtual Box (or any
other preferred virtualization software) from its official website and install it on your
Windows OS.

2. Download Linux ISO File: Go to the official website of your chosen Linux distribution
and download the ISO file.

3. Launch Virtual Box and Create New VM:


- Click on 'New' to create a new virtual machine.
- Name the VM, select the type as 'Linux', and choose the appropriate version.
- Allocate RAM. (Usually 1-2GB is sufficient for basic tasks, but allocate more if required).

4. Set Up Virtual Hard Disk:


- Create a virtual hard disk.
- Choose VDI (Virtual Box Disk Image) as the file type.
- Select whether the storage should be dynamically allocated or of a fixed size.
(Dynamically allocated storage grows as you use it).

240163116010
5. Attach the Linux ISO:
- With the VM highlighted, click on 'Settings'.
- Go to 'Storage', click on the empty disk icon under the IDE controller, and on the right
side, click on the disk icon to choose a virtual optical disk file. Select the downloaded Linux
ISO.

6. Start the Virtual Machine: Click 'Start' on Virtual Box to run the VM. The Linux installer
should boot up.

7. Follow Linux Installation Instructions: Go through the standard Linux installation


procedure within the virtual machine, just as you would on a physical machine.

8. Install Guest Additions: After installation, for better performance and integration
features, it's recommended to install Virtual Box Guest Additions.

Observations:
Step-1: Download & Install Virtualization Software:

Step-2: Download Linux ISO File:

240163116010
Step-3: Launch Virtual Box and Create New VM:

1.

2.

240163116010
Step-4: Set Up Virtual Hard Disk:
1.

2.

Step-5: Attach the Linux ISO:

240163116010
Step-6: Start the Virtual Machine:

Step-7: Follow Linux Installation Instructions:

240163116010
Step-8: Install Guest Additions: After installation, for better performance and integration
features, it's recommended to install Virtual Box Guest Additions.

Result:
1. Virtualization software was installed and configured on the Windows host system.
2. Linux was successfully installed as a guest OS within the virtualized environment.
3. Basic operations within the Linux guest OS were performed, demonstrating its isolated nature.

Conclusion:
The successful installation of Linux as a guest OS on Windows using virtualization software
highlights the importance and practical application of virtualization in modern computing.
Participants gained valuable hands-on experience in setting up and managing virtualized
environments, enhancing their understanding of operating system concepts and architecture. This
exercise provided a solid foundation for further exploration and utilization of virtualization
technology in various computing scenarios.

Quiz:
1. What is the difference between a Host OS and a Guest OS in virtualization?
Answer: The Host OS (Operating System) is the main operating system installed
directly on the physical hardware of a computer, while the Guest OS is an
operating system running within a virtual machine (VM) on the Host OS.

2. Name one popular virtualization software used to run multiple operating systems
on a single machine.
Answer: One popular virtualization software used to run multiple operating
systems on a single machine is VMware.

240163116010
3. Why is it recommended to install Guest Additions in Virtual Box after installing a
Linux guest OS?
Answer: It is recommended to install Guest Additions in VirtualBox after
installing a Linux guest OS because Guest Additions enhance the performance and
usability of the virtual machine by providing features such as better display
resolution, mouse integration, and improved file sharing between the guest and
host operating systems.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 3

Aim: Study of Basic Commands of Linux/UNIX.

Date:

Competency and Practical Skills:


1. Understand the purpose and function of the Linux/UNIX shell.
2. Navigate the file system using basic commands.
3. Manage files and directories efficiently.
4. Access manual pages for detailed command usage.
5. Manage processes on a basic level.

Relevant CO: Learn and understand the concepts, core structure of Operating Systems
and basic architectural components involved in operating systems design

Objectives:
To familiarize students with the fundamental concepts of the Linux/UNIX command line.
To learn and practice essential file and directory management commands.
To understand process management at a basic level using command-line tools.
To leverage the built-in manual system to gain insights into various commands.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
Linux/UNIX commands are textual instructions given by users to interact with the operating
system. These commands can perform various tasks such as file management, process
management, hardware status, and more. The place where users input these commands is
typically referred to as the shell, and the most common shell used is called bash (Bourne
Again SHell).

Procedure:
1. Accessing the Terminal: On most Linux systems, you can open the terminal by pressing
Ctrl + Alt + T. On UNIX-based systems or other Linux desktop environments, the terminal
might be found in the application menu.

2. Basic Commands:
- pwd: Prints the current working directory.
- ls: Lists the contents of the current directory.
- cd [directory_name]: Changes the directory to the specified one.
- touch [filename]: Creates a new empty file.
- mkdir [directory_name]: Creates a new directory.
- rm [filename]: Deletes a file.
- rmdir [directory_name]: Deletes an empty directory.
- cp [source] [destination]: Copies files or directories.
- mv [source] [destination]: Moves or renames files or directories.
- echo [text]: Displays a message or output to the screen.
- man [command_name]: Shows the manual page for the specified command.
- ps: Lists currently running processes.
- kill [process_id]: Kills a running process.

240163116010
3. Practice: It's essential to practice these commands to get a feel for how they work. Start
by navigating through directories, creating files, and viewing processes.

Observations:

· pwd :- displays the current directory.

Syntax: pwd

Output:

· ls :- The ls command in linux is used to display a Directorys files and folders.

Syntax: ls

Output:

· cd :- The cd command is used to change the current directory.

Syntax: cd

Output:

· touch :- Create Empty file

Syntax: touch

Output:

· mkdir :- creates directories with the given names.

Syntax: mkdir dir name

Output:

240163116010
· rm :- delete files

Syntax: rm

Output:

· rmdir :- The rmdir command is used to delete a Directory.

Syntax: rmdir directory name

Output:

· cp :- The cp command is used to copy a file or Directory.

Syntax: cp existing file name new file name

Output:

· mv :- to move one file to another file

Syntax: mv file1_name file2_name

Output:

· echo :- Displays a message or output to the screen.

Syntax: echo “statement”

Output:

240163116010
· ps :- Display the processes in terminal

Syntax: ps

Output:

Result: Through the experiment, proficiency in essential Linux/UNIX commands such as ls,
cd, mkdir, rm, mv , cp And echo was achieved, demonstrating foundational competence in
navigating the command line interface and performing basic file management tasks.

Conclusion: Using ‘mkdir ‘ , ‘touch’ , ‘rm’ ,’rmkdir’ , ‘cp’ , ‘mv’ command , we can successfully
demonstrate file management task . Using ‘ls’ command we can display list of File in
Directory. Using ‘pwd’ command display the path of current directory.

Quiz:
1. What is the purpose of the Pwd command in Linux/UNIX?
Answer: The purpose of the ‘pwd’ command in Linux/UNIX is to print the current
working directory.

2. How can you view the manual or help page of a particular command?
Answer: You can view the manual or help page of a particular command by using
the ‘man’ command followed by the command name. For example, to view the
manual for the ‘ls’ command, you would type ‘man ls’.

3. Which command is used to list all the running processes in the system?
Answer: The command used to list all the running processes in the system is ‘ps’.

4. How would you create a new directory named "Documents" using a command?
Answer: To create a new directory named "Documents" using a command, you
would use the ‘mkdir’ command followed by the directory name. So, the
command would be ‘mkdir Documents’.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 4

Aim: Study of Advanced Commands and Filters of Linux/UNIX.

Date:

Competency and Practical Skills:


1. Understand the power and flexibility of advanced Linux/UNIX commands.
2. Efficiently process and manipulate text data directly from the command line.
3. Combine multiple commands seamlessly using pipes for intricate tasks.
4. Utilize filters effectively for various data transformation needs.

Relevant CO:Learn and understand the concepts, core structure of Operating Systems
and basic architectural components involved in operating systems design

Objectives:
1. To delve deeper into the capabilities of the Linux/UNIX command line beyond basic
operations.
2. To understand and master the use of advanced file and text manipulation commands.
3. To explore and utilize filters for processing text streams and files efficiently.
4. To learn the intricacies of combining multiple commands using pipes (|) for enhanced
functionality.
5. To practice and apply advanced commands and filters in real-world scenarios to optimize
tasks and processes.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
While basic Linux/UNIX commands help in daily tasks, advanced commands and filters
facilitate complex tasks, text processing, and efficient system management. Filters in
UNIX/Linux allow for data manipulation directly from the command line, which can be very
powerful when combined with other commands using pipes (|).

Advanced Commands and Filters:


- grep: Searches for a specific pattern within files.
- awk: A text pattern scanning and processing language.
- sed: A stream editor used for performing basic text transformations.
- sort: Sorts the contents of a text file line by line.
- cut: Removes sections from lines of files.
- tr: Translates or deletes characters.
- uniq: Reports or filters out repeated lines in a file.
- find: Searches for files in a directory hierarchy based on different criteria.

Procedure:

1. Access the Terminal: Open your Linux/UNIX terminal.

2. Using grep: To search for the word "example" in a file named "sample.txt", use grep
"example" sample.txt.

3. Text Manipulation with awk: For example, to print the second column of a file separated
by commas, you'd use awk -F',' '{print $2}' filename.
240163116010
4. Editing Streams with sed: To replace all occurrences of "apple" with "orange" in a file:
sed 's/apple/orange/g' filename.

5. Sorting Text: To sort the contents of "sample.txt": sort sample.txt.

6. Extracting Data with cut: To get the third column of a comma-separated file: cut -d',' -f3
filename.

7. Using find: To locate all .txt files in the current directory and its subdirectories: find . -
name "*.txt".

8. Practice: Combining commands using pipes can achieve complex tasks. For instance, to
count unique lines in a file: sort filename | uniq | wc -l.

Observations:

· grep: Searches for a specific pattern within files.

Code:
cat sample.txt | grep Linux

Output:

· awk: A text pattern scanning and processing language.

Code:

awk -F',' '{print$1}' sample.txt

Output:

· sed: A stream editor used for performing basic text transformations.

Code:
sed 's/apple/orange/g' sample.txt

Output:

240163116010
· sort: Sorts the contents of a text file line by line.

Code:
sort sample.txt

Output:

· cut: Removes sections from lines of files.

Code:
cut -d',' -f3 sample.txt

Output:

· find: Searches for files in a directory hierarchy based on different criteria.

Code:
find . -name “*.txt”

Output:

Result: Through the experiment, proficiency in essential Linux/UNIX commands such as


grep , awk , sed , sort , cut and find was achieved, demonstrating foundational competence in
navigating the command line interface.

Conclusion: Using ‘grep ‘ , ‘awk’ , ‘sed’ ,’sort’ , ‘cut’ command , we can manipulating Output
of “.txt” File. Using ‘find’ command we can display list File with match condition of file
extension.

Quiz:
1. How would you use grep to search for the word "apple" in a file named "fruits.txt"?
Answer: grep "apple" fruits.txt

2. What is the purpose of the awk command in Linux/UNIX?


Answer: `awk` is for text processing, including pattern scanning, extraction, and
manipulation.

240163116010
3. How can the sort and uniq commands be combined to count the number of unique
lines in a file?
Answer: `sort file.txt | uniq -c` combines `sort` to sort lines and `uniq -c` to count
unique lines.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 5

Aim: Write a shell script to generate the mark sheet of a student. Take three
subjects, calculate and display total marks, percentage, and class obtained by
the student.

Date:

Competency and Practical Skills:


1. Understand the flow and structure of shell scripting.
2. Design logic for computing and displaying student results.
3. Implement conditional statements in scripts for decision-making.
4. Develop skills for creating user-interactive scripts.

Relevant CO: Understand the process management policies and scheduling of processes by
CPU.

Objectives:
1. To familiarize students with the logical flow and structuring of algorithms.
2. To help students comprehend the sequential steps involved in mark sheet generation.
3. To encourage students to think critically and develop their script based on the provided
algorithm.
4. To instill a deep understanding of the relationship between user inputs, processing, and
outputs in scripting.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory: A shell script is a sequence of commands for a Unix-based operating system. It's a
text file that contains a series of shell commands and is a way to automate repetitive tasks.
For the given task, we will utilize the shell script's capability to gather inputs, process the
data, and display outputs, focusing on the logic behind generating a student's mark sheet.

Procedure:
1. Initialize:
- Begin the script.
- Declare variables for three subjects, total marks, percentage, and class.

2. Input Marks:
- Prompt the user to enter marks for the first subject and store in the respective variable.
- Prompt for the second subject and store.
- Prompt for the third subject and store.

3. Calculate Total and Percentage:


- Add the marks of the three subjects to get the total marks.
- Calculate the percentage by dividing the total marks by the maximum possible score
(assuming 300 for three subjects) and then multiplying by 100.

4. Determine Class:
- If the percentage is 75% or above, assign "Distinction" to the class variable.
- If the percentage is between 60% and 74%, assign "First Class".
- If the percentage is between 40% and 59%, assign "Second Class".
- Otherwise, assign "Fail".
240163116010
5. Display Results:
- Print the total marks out of 300.
- Display the calculated percentage.
- Show the class obtained by the student.

Observations:

Code:

echo "Enter the Marks of OSV : "


read osv

echo "Enter the Marks of COA : "


read coa

echo "Enter the Marks of OOP-1 : "


read oop

total=$(( $osv + $coa + $oop ))


echo "Total Marks is : $total"

per=$(( ($total * 100) / 300))


echo "Percentage is : $per"

if [ $per -ge 75 ]
then
grade="Distinction"
elif [[ $per -lt 75 && $per -ge 60 ]]
then
grade="First Class"
elif [[ $per -lt 60 && $per -ge 40 ]]
then
grade="Second Class"
else
grade="Fail"
fi

echo "Your grade is : $grade "

Output:

Result: Upon running the shell script mark_sheet.sh and providing the marks for three
subjects as input, the script calculates the total marks, percentage, and determines the class
obtained by the student.

240163116010
Conclusion:
The shell script successfully performs the following tasks:
o Input Collection: It prompts the user to input marks for three subjects.
o Calculation: It calculates the total marks by summing the marks of the three
subjects and computes the percentage based on the total marks out of 300.
o Class Determination: It assigns a class to the student based on the calculated
percentage using the specified criteria (Distinction, First Class, Second Class,
or Fail).
o Result Display: It displays the total marks, percentage, and class obtained by
the student.

Quiz:
1. In the algorithm for the mark sheet script, what's the maximum possible score
assumed for the three subjects?
Answer: In the algorithm for the mark sheet script, the maximum possible score
assumed for the three subjects is 300.

2. How is the "class" of a student determined in the algorithm?


Answer:
The "class" of a student in the mark sheet algorithm is determined as follows:
• Percentage >= 75% → "Distinction"
• Percentage between 60% and 74% → "First Class"
• Percentage between 40% and 59% → "Second Class"
• Percentage below 40% → "Fail"

3. What are the key components of the mark sheet generation algorithm?
Answer:
The key components of the mark sheet generation algorithm are:
· Initialization
· Input Marks
· Calculate Total and Percentage
· Determine Class
· Display Result

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 6

Aim: Write a shell script to display the multiplication table of a given number.

Date:

Competency and Practical Skills:


1. Understand the flow and structure of shell scripting.
2. Design logic for computing and displaying student results.
3. Implement conditional statements in scripts for decision-making.
4. Develop skills for creating user-interactive scripts.

Relevant CO: Understand the process management policies and scheduling of


processes by CPU.

Objectives:
1. Understand how to take user input in a shell script.
2. Implement loops for repetitive tasks in scripts.
3. Manipulate and process user input to generate desired outputs.
4. Design and create scripts that serve practical utilities, like a multiplication table
generator.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
Shell scripting is a powerful tool that allows users to automate tasks in Unix-based
systems. In this context, the script will automate the task of generating a multiplication table
for a specified number. The multiplication table helps in understanding the repeated
addition of the same number.
Procedure:
1. Start the script.

2. Declare variables for the given number and an iterator for looping.

3. User Input:
- Prompt the user to enter a number for which they wish to see the multiplication table.
- Store this number in the respective variable.

4. Multiplication Table Generation:


- Initiate a loop (e.g., a "for" loop) that runs from 1 to 10 (standard multiplication tables go
up to 10, but this can be adjusted based on requirements).
- For each iteration, multiply the given number by the current iterator value.
- Display the result in a formatted way, such as: "5 x 1 = 5" for the first iteration if the user
input was 5.

5. End the loop after 10 iterations.

6. Finish the script.

240163116010
Observations:

Code:

echo "Enter the Number to Multiplication Table : "


read n

echo "The Multiplication table of $n is given below : "

i=1
until [ $i -gt 10 ]
do
mul=$(( $n * $i ))

echo " $n x $i = $mul "

i=$(( $i + 1 ))
done

Output:

Result: The script generates a multiplication table for the specified number up to 10
iterations.

Conclusion: This shell script showcases the automation capability of shell scripting in Unix-
based systems for mathematical operations like generating multiplication tables

Quiz:
1. What is the main purpose of the shell script described in the practical?
Answer: The main purpose of the shell script described in the practical is to
automate the generation of a multiplication table for a specified number.

2. How many times does our multiplication table loop to display results?
Answer: The multiplication table loop in the script displays results up to 10
iterations.

3. If a user enters the number "6", what would be the result displayed for the third
iteration of the multiplication table?
Answer: If a user enters the number "6", the result displayed for the third iteration
of the multiplication table would be: 6 x 3 = 18
240163116010
Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 7

Aim: Write a shell script to find the factorial of a given number n.

Date:

Competency and Practical Skills:


1. Understand the concept of factorial and its mathematical representation.
2. Implement loops in shell scripts to perform iterative calculations.
3. Take user input and process it to produce the desired output.
4. Design and create a script that performs a specific mathematical operation based on user
input.

Relevant CO: Understand the process management policies and scheduling of


processes by CPU.

Objectives:
1. To introduce students to the mathematical concept of factorials.
2. To demonstrate the use of loops in computing factorials using shell scripting.
3. To enhance the students' ability to design and implement scripts for specific mathematical
tasks.
4. To highlight the versatility of shell scripting in handling a variety of computational
problems.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers
less than or equal to n. Mathematically, the factorial function n! can be defined by:

1 if n = 0
n * (n-1)! if n > 0

For instance, the factorial of 4 (4!) is 4 * 3 * 2 *1 = 24 .

Procedure:
1. Start the script.

2. Declare necessary variables: one for the input number \( n \) and another for storing the
factorial result.

3. User Input:
- Prompt the user to enter a number \( n \) for which they wish to find the factorial.
- Store this number.

4. Factorial Calculation:
- Initialize the factorial result variable as 1.
- Use a loop (e.g., a "while" or "for" loop) that runs from 1 to \( n \).
- In each iteration, multiply the factorial result variable by the current iterator value.
- After the loop completes, the factorial result variable will hold the factorial of \( n \).

240163116010
5. Display Result:
- Print the factorial of \( n \).

6. End the script.

Observations:

Code:

echo "Enter the Number to find the factorial : "


read n

factorial()
{
n=$1
fact=1

until [ $n -le 1 ]
do

fact=$(( fact * n ))
n=$(( n - 1 ))
done

echo " Factorial of $no is : $fact"

factorial $n

Output:

Result: If the user enters b=7, the script will display the Factorial of 7 is 5040.

Conclusion: The script effectively demonstrates generating factorial using loops in the
function in shell scripting, providing a hands-on experience in automating such tasks.

Quiz:
1. What is the factorial of a number?
Answer: The factorial of a non-negative integer ( n ), denoted as ( n! ), is the product
of all positive integers less than or equal to ( n ). For example, the factorial of 4 (( 4! ))
is ( 4 x 3 x 2 x 1 = 24 ).

2. How is the factorial of 0 defined?


Answer: The factorial of 0 (( 0! )) is defined as 1, which is a mathematical
convention. It serves as the base case for the factorial function.

240163116010
3. If the user inputs the number "5" for n, what value will the script compute?
Answer: If the user inputs the number "5" for ( n ), the script will compute the
factorial as ( 5! = 5 x 4 x 3 x 2 x 1 = 120 ).

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 8

Aim: Write a shell script that accepts a number b and displays the first n prime
numbers as output.

Date:

Competency and Practical Skills:


1. Understand the concept of prime numbers.
2. Implement loops and nested loops in shell scripts.
3. Use conditional statements to determine the prime nature of a number.
4. Develop scripts that generate specific sequences or patterns based on user input.

Objectives:
1. To introduce students to the concept of prime numbers and their properties.
2. To demonstrate the use of loops and conditions in generating specific numeric sequences
in shell scripting.
3. To encourage logical thinking and problem-solving through algorithm design.
4. To provide hands-on experience in writing scripts that take user input and generate
specific outputs.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
A prime number is a natural number greater than 1 that is not a product of two smaller
natural numbers. In other words, it has only two distinct positive divisors: 1 and itself. For
instance, the first six prime numbers are 2, 3, 5, 7, 11, and 13. Shell scripts allow automation
of such tasks where repetitive checking or calculations, like checking for prime numbers, are
needed.

Procedure:

1. Start the script.

2. Declare necessary variables: one for the input number b, a counter for found prime
numbers, and an iterator for checking each number.

3. User Input:
- Prompt the user to enter a number b indicating how many prime numbers they wish to
see.
- Store this number.

4. Prime Number Generation:


- Start an indefinite loop until b prime numbers are found.
- For each number, check if it's prime:
- Initialize a 'is Prime' variable as true.
- Start a loop from 2 up to the square root of the current number.
- If the current number is divisible by any number in this loop, set 'is Prime' to false and
break the loop.
- If 'is Prime' remains true after the loop, display the current number as a prime number
and increment the prime counter.
240163116010
- Continue the process until b prime numbers are displayed.

5. End the script.

Observations:

Code:

echo "Enter the Number : "


read n
x=0
i=2
prime()
{
n=$1
while [ $x -lt $n ]
do j=2
flag=1
while [ $j -le $(( $i / 2 )) ]
do
prime=$(( $i % $j ))
if [ $prime -eq 0 ]
then
flag=0
break
fi
j=$(( $j + 1 ))
done

if [ $flag -eq 1 ]
then
echo " $i is prime "
x=$(( $x + 1 ))
fi
i=$(( $i + 1 ))

done
}
prime $n

Output:

Result: If the user enters b=4, the script will display the first 4 prime numbers: 2, 3, 5, and 7.
Sufficient space to be provided

240163116010
Conclusion: The script effectively demonstrates generating prime numbers using loops and
conditional statements in shell scripting, providing a hands-on experience in automating
such tasks.

Quiz:
1. What is a prime number?
Answer: A prime number is a natural number greater than 1 that is not a product of
two smaller natural numbers.

2. How many divisors does a prime number have?


Answer: A prime number has two divisors: 1 and itself.

3. If the user enters the number "4" for b, how many prime numbers will the script
display?
Answer: If the user enters the number "4" for ( b ), the script will display the first 4
prime numbers. These prime numbers are: 2, 3, 5, and 7.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 9

Aim: Write a shell script which will generate first n Fibonacci numbers like: 1,
1, 2, 3, 5, 13,18

Date:

Competency and Practical Skills:


1. Understand the nature and pattern of the Fibonacci sequence.
2. Implement loops in shell scripts to generate a number sequence.
3. Use arithmetic operations to calculate and update sequence values.
4. Design scripts that produce numeric patterns based on user input.

Relevant CO: Understand the process management policies and scheduling of


processes by CPU.

Objectives:
1. To teach students about the Fibonacci sequence and its properties.
2. To demonstrate the use of loops and arithmetic operations in generating
the Fibonacci sequence using shell scripting.
3. To instill logical and sequential thinking in algorithm design.
4. To offer a practical exercise in writing scripts for generating numeric
patterns.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
The Fibonacci sequence is a series of numbers in which each number is the sum of
the two preceding ones. Typically, the sequence starts with 0 and 1. In mathematical terms,
the sequence F(n) is defined by the recurrence relation:

F(n) = F(n-1) + F(n-2)


with seed values:
F(0) = 0, F(1) = 1

Procedure:

1. Start the script.

2. Declare necessary variables: one for the input number n, and two initial seed numbers for
the Fibonacci sequence (0 and 1).

3. User Input:
- Prompt the user to enter a number n indicating how many Fibonacci numbers they wish
to see.
- Store this number.

4. Fibonacci Number Generation:


- If n is 1, display the first Fibonacci number.
- If n is greater than 1, display the first two Fibonacci numbers.
- Initialize a loop that runs n - 2 times (since the first two numbers are already displayed).
- Calculate the next Fibonacci number as the sum of the two preceding ones.
240163116010
- Display the calculated Fibonacci number.
- Update the two preceding Fibonacci numbers for the next iteration.

5. End the script.

Observations:

Code:

echo "Enter the Number : "


read n

a=0
b=1

echo "The Fibonacci series is : "


i=0
while [ $i -lt $n ]
do
echo -n "$a "
fn=$(( a + b ))
a=$b
b=$fn
i=$(( $i + 1 ))

done

Output:

Result: If the user enters n=6, the script will display the first 6 Fibonacci numbers: 0, 1, 1, 2,
3, and 5.

Conclusion: The script effectively demonstrates generating Fibonacci numbers using loops
and arithmetic operations in shell scripting, providing a practical exercise in generating
numeric sequences.

Quiz:
1. How is each number in the Fibonacci sequence generated?
Answer: Each number in the Fibonacci sequence (starting from the third number) is
generated by adding the two preceding numbers. Mathematically, it follows the
recurrence relation ( F(n) = F(n-1) + F(n-2) ) where ( F(0) = 0 ) and ( F(1) = 1 ).

2. What are the first two numbers in the Fibonacci sequence?


Answer: The first two numbers in the Fibonacci sequence are 0 and 1.

240163116010
3. If the user inputs the number "6" for n, how many Fibonacci numbers will the
script display?
Answer: If the user inputs the number "6" for ( n ), the script will display the first 6
Fibonacci numbers.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 10

Aim: Write a menu-driven shell script that presents the following options to the
user and executes the corresponding task:

a. Display calendar of the current month


b. Display today’s date and time
c. Display usernames that are currently logged in the system
d. Display your name at a given x, y position
e. Display your terminal number

Date:

Competency and Practical Skills:


1. Design and implement a menu-driven interface in a shell script.
2. Utilize built-in UNIX commands for various tasks.
3. Implement loops and conditional statements for user interaction and choice- based
task execution.
4. Understand the purpose and usage of commands like Cal, date, who, tput, and tty.

Relevant CO: Understand the process management policies and scheduling of


processes by CPU.

Objectives:
1. To teach students how to create interactive, menu-driven shell scripts.
2. To familiarize students with various built-in UNIX commands and their utilities.
3. To instill a practical understanding of how to use shell scripting to automate and
streamline tasks.
4. To demonstrate the concept of loops and conditional statements in creating interactive
scripts.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
A menu-driven program provides users with a selection of choices in the form of a menu.
The user's choice determines the action the program will take. In a shell script, such menu-
driven interfaces can be built using loops, conditional statements, and built-in commands.

Procedure:
1. Start the script.

2. Display Menu:
- Use a loop (e.g., a "while" loop) to repeatedly display the menu and prompt for user input
until the user chooses to exit.
- Display the options:
a. Display calendar of the current month
b. Display today’s date and time
c. Display usernames currently logged in the system
d. Display your name at a given x, y position
e. Display your terminal number
f. Exit

240163116010
3. Get User Input:
- Prompt the user to select an option from the menu.

4. Execute Task Based on Choice:


- Use a conditional statement (e.g., "case" or "if-else ") to determine the user's choice.
- For option 'a', use the Cal command to display the current month's calendar.
- For option 'b', use the date command to display the current date and time.
- For option 'c', use the who command to list all logged-in users.
- For option’d’, prompt the user for x and y coordinates and then use the tput command to
position the cursor and echo the user's name.
- For option 'e', use the tty command to display the terminal number.
- For option 'f', exit the loop and end the script.

5. Loop back to step 2 until the user chooses to exit.

6. End the script.

Observations:

Code:
echo " A. Calendar of Current Month "
echo " B. Today's Date & Time "
echo " C. Current logged-in User "
echo " D. Name at any Position "
echo " E. Terminal Number "
echo " F. Exit "

mul=0

until [ $mul -ne 0 ]


do

echo "Enter Your Choice : "


read op

case $op in
"A" | "a" )
echo " Calender of Current Month is : "
cal
;;
"B" | "b")
echo " Today's Date & Time is : "
date
;;

"C" | "c")
echo "Current logged-in user is : "
who
;;
"D" | "d")
row=$(tput lines)
col=$(tput cols)
echo "Terminal Window has Rows=$row Cols=$col"
echo "Enter X & Y Position "
read x
read y

echo "Enter Your Name : "


240163116010
read name

tput cup $x $y

echo "$name"
;;
"E" | "e")
echo "Terminal Number is : "
tty

;;
"F" | "f" )
echo "Exiting ... "
mul=1
exit
;;

*)

esac
done

Output:

Result: When the user runs this script, they will be presented with a menu and can choose
options to perform various tasks.

240163116010
Conclusion: The script effectively demonstrates creating a menu-driven interface in a shell
script, allowing users to interactively choose and execute tasks.

Quiz:
1. Which command is used to display the calendar of the current month?
Answer: The `cal` command is used to display the calendar of the current month in
the shell script.

2. How can you display the names of users currently logged in to the system?
Answer: The `who` command is used to display the names of users currently logged
in to the system in the shell script.

3. What does the tty command display?


Answer: The `tty` command displays the terminal number or file name of the
terminal connected to standard input in the shell script.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 11

Aim: Write a shell script to read n numbers as command arguments and sort
them in descending order

Date:

Competency and Practical Skills:


1. Understand and utilize command-line arguments in shell scripts.
2. Implement sorting algorithms, specifically the bubble sort in this context, in scripts.
3. Manipulate and process arrays in shell scripting.
4. Design and implement scripts that sort and display data based on user input.

Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system.

Objectives:
1. To familiarize students with the use of command-line arguments in shell scripts.
2. To introduce the concept of sorting and its implementation using loops.
3. To encourage the use of arrays in shell scripting for data processing.
4. To demonstrate the practical utility of shell scripts in processing and displaying sorted
data.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory: Command-line arguments are a method of passing input to a script at the time of
execution. In shell scripting, these arguments can be accessed via special variables: $1, $2,
$3, ... representing the first, second, third argument, and so on. $# holds the count of total
arguments passed. Sorting is the process of arranging items systematically. For this task, we
will arrange numbers in descending order.

Procedure:

1. Start the script.

2. Check Argument Count:


- If no arguments are passed or only one is passed, print an appropriate message and exit.
Sorting requires at least two numbers.

3. Read Command-line Arguments:


- Read all numbers passed as command-line arguments into an array.

4. Sort the Numbers in Descending Order:


- Use a nested loop (e.g., a "for" loop inside another "for" loop) for sorting.
- In each iteration of the outer loop, traverse through the array using the inner loop.
- Compare adjacent elements of the array. If the current element is smaller than the next
element, swap them.
- Continue the process until the entire array is sorted in descending order.

5. Display Result:
- Print the sorted numbers.

240163116010
6. End the script.

Observations:

Code:

#!/bin/bash

echo "How Many Number You want to Enter : "


read n

i=0

declare -a arr

until [ $i -ge $n ]
do
echo "Enter value of arr[$i]: "
read arr[$i]
i=$(( $i + 1 ))

done

k=0
until [ $k -ge $n ]
do
j=0
while [ $j -le $(( $n - $k - 1 )) ]
do
if [[ ${arr[$j]} -lt ${arr[$(( $j + 1 ))]} ]]
then
temp=${arr[ $j ]}
arr[$j]=${arr[$(( $j + 1 ))]}
arr[$(( $j + 1 ))]=$temp
fi
j=$(( $j + 1 ))
done
k=$(( $k + 1 ))
done
echo "Numbers in Descending order: "
echo "${arr[*]} "

Output:

240163116010
Result: When the script is executed with command-line arguments (e.g.,
./sort_descending.sh 5 2 7 1), it will sort the numbers in descending order and display the
sorted numbers.

Conclusion: The script effectively sorts numbers in descending order using the bubble sort
algorithm and demonstrates the use of command-line arguments and arrays in shell
scripting.

Quiz:
1. How can you access the first command-line argument in a shell script?
Answer: You can access the first command-line argument in a shell script using the
special variable `$1`.

2. What special variable holds the total count of command-line arguments passed to a
script?
Answer: The special variable `$#` holds the total count of command-line arguments
passed to a script.

3. Why is it necessary to have at least two numbers for sorting?


Answer: It is necessary to have at least two numbers for sorting because sorting
involves comparing elements. In the case of sorting algorithms like bubble sort,
comparisons are made between adjacent elements to determine their relative order.
If there is only one element, there's nothing to compare it with, so sorting is not
possible.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 12

Aim: Write a shell script to display all executable files, directories, and zero-
sized files from the current directory.

Date:

Competency and Practical Skills:


1. Understand file and directory permissions in UNIX-like operating systems.
2. Utilize shell commands to detect specific attributes of files and directories.
3. Implement conditional statements in scripts to filter and display files based on their
properties.
4. Design and implement scripts that provide insights into the content of
directories.

Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system.

Objectives:
1. To educate students about the permission system of UNIX-like operating systems and its
significance.
2. To demonstrate the ability to filter and display directory content based on specific criteria
using shell scripting.
3. To encourage students to explore various commands and options that can be used to
glean information about files.
4. To provide a hands-on experience in creating scripts that present organized information
based on file attributes.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
In UNIX-like operating systems, files and directories have associated *permissions* that
determine who can read, write, or execute them. An executable file is one that has the
execute permission set for the user, group, or others. Directories with the execute
permission can be accessed and traversed. A zero-sized file, as the name suggests, has a size
of 0 bytes.

Using the ls command with specific options and filters, one can list files based on their
attributes. Combined with if conditions, shell scripts can be used to detect and display files
with specific properties.

Procedure:
1. Start the script.

2. List and Filter Files:


- Iterate over all files and directories in the current directory.
- For each item:
a. If it's an executable file, display it under the "Executable Files" category.
b. If it's a directory, display it under the "Directories" category.
c. If it's a zero-sized file, display it under the "Zero-sized Files" category.

3. End the script.


240163116010
Observations:

Code:

echo "Executable Files:"


for file in *
do
if [ -x "$file" ]
then
echo "$file"
fi
done
echo
echo "Directories:"
for dir in */
do
echo "$dir"
done
echo
echo "Zero-sized Files:"
for file in *
do
if [ -s "$file" ]
then
echo "$file"
fi
done

Output:

Result: When executed, the script will display all executable files, directories, and zero-sized
files from the current directory.

Conclusion: The script effectively demonstrates how to filter and display files based on
their attributes using shell scripting and the ls command with specific options and
conditions.

Quiz:
1. How can you identify an executable file in a UNIX-like system?
Answer: In a UNIX-like system, you can identify an executable file by checking its
execute permission. If the execute permission is set for the user, group, or others, the
file is considered executable. This can be checked using the ls -l command, where an
"x" in the permission field indicates execute permission.

240163116010
2. What is the significance of the execute permission on a directory?
Answer: The execute permission on a directory is significant because it allows users
to access and traverse the directory. Without the execute permission, users won't be
able to list the contents of the directory or access files within it, even if they have
read permission on those files. Essentially, the execute permission on a directory
controls whether users can enter and interact with it.

3. What size, in bytes, does a zero-sized file have?


Answer: A zero-sized file has a size of 0 bytes. It contains no data and is essentially
an empty file.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 13

Aim: Write a shell script to check if the entered string is a palindrome or not.

Date:

Competency and Practical Skills:


1. Understand the concept of palindromes and their properties.
2. Implement string manipulation operations in shell scripts.
3. Use conditional statements to compare strings and determine their
characteristics.
4. Design and implement scripts that analyze and provide feedback on user input.

Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system.

Objectives:
1. To introduce students to the concept of palindromes and how to programmatically
identify them.
2. To teach students about string operations and comparisons in shell scripting.
3. To promote logical thinking and the utilization of string manipulation techniques.
4. To give students a hands-on experience in creating scripts that evaluate and provide
feedback on string-based user input.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
A palindrome is a word, phrase, number, or other sequences of characters that reads the
same forward and backward (ignoring spaces, punctuation, and capitalization). Examples of
palindromic words are "radar", "level", and "deified". In this practical, the focus will be on
checking palindromic words. To determine if a string is a palindrome, we compare the string
to its reverse. If they are the same, the string is palindromic.

Procedure:
1. Start the script.

2. User Input:
- Prompt the user to enter a string.
- Store this string.

3. Check if Palindrome:
- Reverse the entered string.
- Compare the reversed string with the original string.
- If they match, the string is a palindrome.
- If not, the string is not a palindrome.

4. Display Result:
- Print the result based on the comparison.

5. End the script.

240163116010
Observations:

Code:

echo "Enter a string:"


read str
length=${#str}

i=$length
while [ $i -ge 0 ]
do
rev_str="$rev_str$( expr substr $str $i 1 )"
i=$(( $i - 1 ))
done

echo " Reverse string of $str is : $rev_str "

if [ $str = $rev_str ]
then

echo " Reverse string & Original string are same , So $str is Pailindrome "
else
echo " Reverse string & Original string aren't same , So $str isn't Paillindrome "
fi

Output:

Result: When we executing, the script will prompt to enter a string. After entering the
string, it will determine if the string is a palindrome or not and display the result.

Conclusion: The script effectively checks if a string is a palindrome using string


manipulation and comparison techniques in shell scripting.

Quiz:
1. What is a palindrome?
Answer: A palindrome is a word, phrase, number, or sequence of characters that
reads the same backward as forward. For example, "radar," "level," and "deified" are
palindromic words.

2. If the entered string is "MADAM", will the script categorize it as a palindrome?


Answer: Yes, the script will categorize the string "MADAM" as a palindrome because
it reads the same backward as forward, ignoring spaces, punctuation, and
capitalization.

3. What operation is primarily used to determine if a string is a palindrome?


Answer: The primary operation used to determine if a string is a palindrome is
comparing the string to its reverse. If the string remains the same when read
backward, it is considered a palindrome.

240163116010
Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 14

Aim: Introduction to shell programming using filters, with a focus on grep,


egrep, and fgrep.

Date:

Competency and Practical Skills:


1. Understand the function and application of filters in UNIX.
2. Utilize grep, egrep, and fgrep to search patterns and strings in files.
3. Differentiate between basic and extended regular expressions.
4. Combine filtering commands with other UNIX commands to produce desired outputs.

Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system.

Objectives:
1. To familiarize students with the concept of filters in UNIX and their applications.
2. To introduce students to the capabilities and uses of grep, egrep, and fgrep.
3. To encourage the use of filtering commands in processing and searching text data.
4. To provide insights into how pattern searching and regular expressions work in UNIX-like
systems.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
Filters in UNIX are commands that process text data, producing useful transformations on
the input. They are often combined with other commands using pipes | to process streams of
data.

Among the many filters, grep and its variants (egrep and fgrep) are especially popular:

- grep: Stands for "global regular expression print." It searches the given file for lines
containing a match to the given pattern or string. By default, grep displays the matching
lines.

- egrep: Stands for "extended grep". It functions the same as grep -E and treats patterns as
extended regular expressions.

- fgrep: Stands for "fixed grep". It functions the same as grep -F and treats patterns as fixed
strings (no special characters, etc.)

Procedure:
1. Using grep:
- Command: grep 'pattern' filename
- Use case: To search for a specific pattern in a file.

2. Using egrep:
- Command: egrep 'pattern1|pattern2' filename
- Use case: To search for lines containing either "pattern1" or "pattern2" in a file using
extended regular expressions.

240163116010
3. Using fgrep:
- Command: fgrep 'pattern' filename
- Use case: To search for a string without treating any characters as special characters or
regular expressions.

Observations:

Code:

echo "Using grep:"


grep 'Hello' file.txt

echo "Using egrep:"


egrep 'This|System' file.txt

echo "Using fgrep:"


fgrep 'Virtual' file.txt

Output:

Result: The provided shell script demonstrates the usage of grep, egrep, and fgrep
commands in UNIX/Linux shell programming. When executed, the script creates a sample
text file and performs pattern matching operations using these filtering commands.

Conclusion: The experiment successfully showcased the capabilities of grep, egrep, and
fgrep commands in filtering text data based on specified patterns or strings. Students gained
practical experience in using these commands to search for and display lines matching
specific criteria within a file. Understanding and utilizing such filters are essential skills for
text processing and pattern matching tasks in UNIX/Linux environments.

Quiz:
1. What does the grep command do in UNIX?
Answer: The grep command in UNIX searches for lines in files that match a specified
pattern or string and then print those lines.

2. Which command treats patterns as extended regular expressions?


Answer: The egrep command (or grep -E) treats patterns as extended regular
expressions in UNIX, allowing for more complex pattern matching.

3. What is the primary difference between grep and fgrep?


Answer: The primary difference between grep and fgrep is that fgrep (or grep -F)
treats patterns as fixed strings, meaning it doesn't interpret any characters as special
characters or regular expressions, providing a literal match.

240163116010
Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 15

Aim: Study of UNIX Shell and Environment Variables.

Date:

Competency and Practical Skills:


1. Understand the role and functionality of the UNIX shell.
2. Recognize the differences and features of various UNIX shells.
3. Understand what environment variables are and their significance in Unix-like
operating systems.
4. Access, modify, and utilize environment variables in the shell.

Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
1. Unix Shell:
- The Unix shell is both a command-line interface and a powerful scripting environment. It
provides an interface for users to interact with the Unix operating system.
- Various shells are available, such as the Bourne Shell (sh), Bourne Again Shell (bash), C
Shell (csh), and the Korn Shell (ksh), each with its own set of features and syntax.
- The shell reads commands typed by a user and translates them into a form that the
operating system can understand. It also provides functionalities such as variable
substitution, loops, and conditionals within shell scripts.

2. Environment Variables:
- Environment variables are a set of dynamic named values that can affect the way running
processes behave on a computer. They exist as part of the environment in which a process
runs.
- These variables are used by the shell and other programs to get information about the
environment, like the home directory, current path, or the terminal type.
- Some common environment variables include PATH (which specifies directories where
executable programs are located), HOME (which indicates the home directory of the current
user), and LANG (which defines the system's language and character set).

Procedure:
1. Accessing Environment Variables:
- You can access an environment variable in the shell using the syntax $VARIABLE_NAME.
For instance, echo $HOME will display the home directory of the current user.

2. Setting Environment Variables:


- You can set an environment variable for the current session using the export command in
many shells. For example, export VAR_NAME=value.

3. Listing All Environment Variables:


- The printenv command (used without arguments) will list all environment variables.
Specific variables can be queried, like printenv PATH.
240163116010
Observations:

Environment variables or ENVs basically define the behavior of the environment. They can
affect the processes ongoing or the programs that are executed in the environment. Scope of
an environment variable:- Scope of any variable is the region from which it can be accessed
or over which it is defined. An environment variable in Linux can have global or local scope.
Global: - A globally scoped ENV that is defined in a terminal can be accessed from anywhere
in that particular environment which exists in the terminal. That means it can be used in all
kind of scripts, programs or processes running in the environment bound by that terminal.
Local A locally scoped ENV that is defined in a terminal cannot be accessed by any program
or process running in the terminal. It can only be accessed by the terminal (in which it was
defined) itself.

Result: Familiarity with different shells and their functions, ability to manage environment
variables, and practical knowledge of commands like `echo`, `export`, and `printenv`.

Conclusion: Mastering Unix shells and environment variables enhances system


management and scripting capabilities, improving efficiency and productivity in Unix-based
systems.

Quiz:
1. What is the role of the UNIX shell?
Answer: The role of the UNIX shell is to provide a command-line interface and scripting
environment, allowing users to interact with the operating system by executing commands
and writing scripts.

2. Name two common environment variables in Unix-like systems.


Answer: Two common environment variables in Unix-like systems are:
o PATH: Specifies directories where executable programs are located.
o HOME: Indicates the home directory of the current user.

3. How can you display the value of an environment variable named VAR_NAME?
Answer: You can display the value of an environment variable named VAR_NAME using the
`echo` command with the syntax `$VAR_NAME`. For example, to display the value of a
variable named MYVAR, you would use `echo $MYVAR`.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 16

Aim: Write a shell script to validate the entered date. (eg. Date format is: dd-
mm-yyyy).

Date:

Competency and Practical Skills:


1. Understand the complexities of date validation.
2. Implement conditional checks and string manipulations in shell scripts.
3. Utilize arithmetic operations and modularity checks to determine leap years.
4. Design and implement scripts that validate user input based on defined criteria.

Relevant CO: Understand the process management policies and scheduling of


processes by CPU

Objectives:
1. To introduce students to the concept of date validation and the intricacies associated with
calendar systems.
2. To teach students about the conditions that determine leap years and how they affect date
validation.
3. To encourage logical thinking and problem-solving through the implementation of
validation checks.
4. To provide hands-on experience in validating and processing user input in shell scripts.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
Date validation is the process of ensuring that a given date string matches a specified
format and represents a valid calendar date. In this context, the date format is "dd-mm-
yyyy". Validation needs to consider factors like the number of days in each month and leap
years.

Procedure:
1. Start the script.

2. User Input:
- Prompt the user to enter a date in the format "dd-mm-yyyy".
- Store this date.

3. Break Date into Components:


- Extract day, month, and year from the entered date using string manipulation.

4. Validation:
- Check if the extracted day, month, and year are numeric values.
- Ensure the month is between 01 and 12.
- Ensure the day is between 01 and the maximum valid day for the given month (e.g., 01-31
for January, 01-28 or 01-29 for February depending on whether the year is a leap year or
not).
- A year is a leap year if:
- It is divisible by 4 and not divisible by 100 OR
- It is divisible by 400.
240163116010
5. Display Result:
- If the date is valid, print a message confirming its validity.
- Otherwise, print an error message.

6. End the script.

Observations:

Code:

echo "Enter the Date as Formate [ DD-MM-YYYY ]"


read date

length=${#date}

if [ $length -eq 10 ]
then

day=$( expr substr $date 1 2)


month=$( expr substr $date 4 2 )
year=$( expr substr $date 7 4 )

if [ ${#day} -eq 2 ] && [ ${#month} -eq 2 ] && [ ${#year} -eq 4 ]


then
if [ $month -le 0 ] && [ $month -gt 12 ]
then
echo " Invalid Month "
else

case $month in
01 |03 |05 |07 |08 |10 |12 )
days=31
;;
04 |06 |09 |11 )
days=30
;;
02 )
if [ $(( $year % 4 )) -eq 0 ]
then
days=29
else
days=28
fi
;;
* )
days=0
;;

esac
fi
if [ $day -ge 0 ] && [ $day -le $days ]
then
echo " $date is valid date "
else
echo " Invalid Date "
fi
else
echo "Invalid Date "
fi

240163116010
else
echo " Invalid Format of Date "

fi

Output:

Result: If the user enters a date in the correct "dd-mm-yyyy" format and it is a valid
calendar date, the script will display a message confirming its validity.If the input date
format is incorrect or the date is invalid (e.g., February 30), the script will display an error
message indicating the issue.

Conclusion: This shell script effectively validates user input for dates in the "dd-mm-yyyy"
format. It breaks down the date into day, month, and year components and performs checks
to ensure the date is within valid ranges and adheres to the rules of leap years. By
incorporating string manipulation and conditional statements, the script provides a robust
method for date validation in Unix-like systems.

Quiz:
1. What is the primary reason February can have either 28 or 29 days?
Answer: February can have either 28 or 29 days due to the leap year rule, which
adds an extra day to February every four years to keep the calendar year
synchronized with the astronomical year.

2. How do you determine if a year is a leap year?


Answer: A year is considered a leap year if it is divisible by 4 and not divisible by
100, unless it is also divisible by 400. This rule accounts for the varying lengths of
February in different years.

3. If a user enters "31-04-2023" as the date, is this valid?


Answer: No, "31-04-2023" is not a valid date. April has only 30 days, so the date "31-
04-2023" exceeds the maximum number of days in April.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 17

Aim: Write an awk program using function, which convert each word in a given
text into capital.

Date:

Competency and Practical Skills:


1. Understand the foundational concepts of the awk programming language and its
application in text processing.
2. Design custom functions within awk to achieve specific text manipulations.
3. Implement pattern matching and processing to transform input data.
4. Efficiently utilize awk's capabilities to capitalize and format text as desired.

Relevant CO: Understand the process management policies and scheduling of


processes by CPU

Objectives:
1. To introduce students to the capabilities and functionalities of the awk programming
language, especially in the realm of text processing.
2. To showcase the design and application of custom functions in awk.
3. To instill an understanding of pattern matching, data processing, and transformation
using awk.
4. To provide a clear and structured approach to capitalizing text, emphasizing algorithmic
thinking and design.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
awk is a text-processing programming language that is particularly well-suited for
structured data and produces formatted reports. The language is data-driven and is used for
pattern scanning and processing. It provides a way to create small and simple programs to
transform and report on data within files.
A crucial aspect of awk is its ability to match patterns and perform actions on the
matched data. Functions, both built-in and user-defined, can further extend its capabilities.
One such task is to capitalize the first letter of each word in a text.

Procedure:
1. Define the Capitalize Function:
- Accept a string as input.
- Extract the first letter of the string and convert it to uppercase.
- Append the remainder of the string (from the second character onwards) to the
uppercase letter without changing its case.
- Return the combined result as the capitalized word.

2. Read Input Line by Line:


- For each line of the input text, split the line into individual words.

3. Process Each Word:


- For every word in the line:
- Apply the previously defined capitalize function.
- Replace the original word with the capitalized version in the line.
240163116010
4. Output the Modified Line:
- After processing all words in the current line, print the modified line to the output.
- Move to the next line of the input text and repeat the process until all lines are processed.

Observations:

Code:

echo "Enter the String in LowerCase to convert in UpperCase : "


read str

UpperCase()
{

echo "Converted Uppercase string is : "


echo "$1"| awk '{ print toupper($0) } '
}

UpperCase $str

Output:

Result: The result of the experiment aligns with the theoretical expectations. The awk
program successfully capitalized each word in the input text, demonstrating the
effectiveness of using awk for text processing tasks. This experiment showcased the
capabilities of awk in manipulating and transforming textual data, highlighting its role in
automating text-related operations.

Conclusion: This awk program successfully capitalizes each word in the input text using a
custom capitalize function. It demonstrates the power and flexibility of awk in text
processing tasks, allowing for efficient manipulation and transformation of textual data.

Quiz:
1. What is awk primarily used for?
Answer: Awk is primarily used for text processing and manipulation, particularly in
structured data and reporting tasks.

2. How does awk handle the processing of input data by default?


Answer: Awk processes input data line by line by default, allowing for easy handling
and transformation of text.

3. In the context of the provided algorithm, what is the main purpose of the capitalize
function?
Answer: The main purpose of the capitalize function in the provided algorithm is to
convert the first letter of each word in a text to uppercase while preserving the rest
of the word in its original case.
240163116010
Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 18

Aim: Write a program for process creation using C. (Use of gcc compiler)

Date:

Competency and Practical Skills:


1. Understand the UNIX process model and the concept of parent and child
processes.
2. Utilize the fork() system call to create new processes.
3. Differentiate between parent and child processes based on the return value of fork().
4. Design and implement C programs that create and manage processes.

Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system

Objectives:
1. To introduce students to the fundamentals of process management in UNIX-like operating
systems.
2. To educate on the usage and significance of the fork() system call in creating new
processes.
3. To demonstrate the creation and differentiation of parent and child processes in a C
program.
4. To foster an understanding of how processes are managed and controlled in a UNIX
environment.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
In UNIX-like operating systems, the creation of a new process is accomplished using
the fork() system call. When a process calls fork(), it creates a new process called the child
process. The original process is called the parent process.

The child process is an almost exact copy of the parent process. Both processes will
continue executing from the point of the fork() call. The main difference is the value
returned by fork(). In the child process, fork() returns 0, while in the parent, it returns the
child's process ID.

This distinction can be utilized to differentiate the roles of the parent and child processes in
the program.

Procedure:
1. Begin the program.
2. Call the fork() function.
3. Check the return value of fork().
- If the return value is negative, the fork failed.
- If the return value is zero, the current code block is being executed by the child process.
- If the return value is positive, the current code block is being executed by the parent
process.
4. In the child process, print a message indicating that it's the child process and display its
process ID.

240163116010
5. In the parent process, print a message indicating that it's the parent process, display its
process ID, and also display the child's process ID.
6. End the program.

Observations:

Code:

#include <stdio.h>
#include <unistd.h>

int main()
{
pid_t pid;

pid = fork();

if (pid < 0)
{
fprintf(stderr, "Fork failed\n");
return 1;
}
else if (pid == 0)
{
printf("Child process: PID = %d\n", getpid());
}
else
{
printf("Parent process: PID = %d\n", getpid());
printf("Child process ID: %d\n", pid);
}

return 0;
}

Output:

Result: The result of running the provided C program to demonstrate process creation
using fork() would be the output indicating whether the current process is the parent or
child, along with their respective process IDs.

Conclusion: This experiment successfully demonstrates the concept of process creation in a


Unix-like environment using the fork() system call. The parent process creates a child
process using fork(), and both processes continue executing from the point of the fork() call.
By checking the return value of fork(), we can differentiate between the parent and child
processes and perform specific actions based on their roles. This experiment enhances
understanding of the UNIX process model and the roles of parent and child processes in
process management.

240163116010
Quiz:
1. What is the primary function used to create a new process in UNIX-like systems?
Answer: The primary function used to create a new process in UNIX-like systems is
the `fork()` system call.

2. How can you differentiate between the child and parent processes after the fork()
call?
Answer: You can differentiate between the child and parent processes after the
`fork()` call by checking the return value of `fork()`. In the child process, `fork()`
returns 0, while in the parent process, it returns the process ID (PID) of the child
process.

3. What does fork() return in the child process?


Answer: In the child process, `fork()` returns 0.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 19

Aim: Study the concepts of virtual machines and virtualization.

Date:

Competency and Practical Skills:


1. Understand the fundamental principles behind virtual machines and
virtualization.
2. Differentiate between various types of virtualization.
3. Recognize the benefits and potential challenges of implementing virtualization in an IT
environment.
4. Conceptualize how hypervisors work and differentiate between Type 1 and Type 2
hypervisors.

Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system

Objectives:
1. To introduce students to the foundational concepts of virtual machines and the broader
realm of virtualization.
2. To impart knowledge about the advantages, challenges, and use cases of virtualization in
modern IT infrastructures.
3. To educate on the roles and functions of hypervisors in a virtualized environment.
4. To provide insights into various types of virtualization, enabling students to make
informed decisions in real-world applications.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
1. Virtual Machines (VM):
- A Virtual Machine (VM) is a software-based simulation of a physical computer. It runs in
an isolated environment on a host system with the help of virtualization software. A VM
operates similarly to a physical computer, having its own CPU, memory, disk space, and I/O.

2. Virtualization:
- Virtualization refers to the act of creating a virtual (rather than physical) version of
computing resources. It allows for the creation of multiple virtual environments on a single
physical system.
- At the heart of virtualization is the *hypervisor*, a software layer or platform that
manages the distribution of the underlying hardware resources to the virtual machines.
There are two types of hypervisors:
a. Type 1 (Bare Metal): Runs directly on the system's hardware.
b. Type 2 (Hosted): Runs atop a conventional operating system.

Advantages of Virtualization:

1. Resource Efficiency: Multiple VMs can run on a single physical server, optimizing
hardware usage.
2. Isolation: VMs are isolated from each other. If one VM crashes, it doesn’t affect others.
3. Snapshot and Cloning: VMs can be snapshotted to capture their current state, allowing
easy rollback. They can also be cloned for quick deployment.
240163116010
4. Flexibility and Testing: VMs can run different operating systems on the same physical
host, which is beneficial for application testing across different environments.
5. Cost Savings: Virtualization can reduce the need for physical hardware, leading to cost
savings in hardware procurement and energy consumption.

Types of Virtualization:
1. Hardware/Platform Virtualization: Creation of VMs which act like real computers with
an operating system.
2. Network Virtualization: Splitting available bandwidth in a network into independent
channels which can be assigned to particular servers or devices.
3. Storage Virtualization: Pooling physical storage from multiple devices and presenting it
as a single storage device.
4. Application Virtualization: Packaging an application along with its runtime
environment to run on any compatible underlying OS.

Observations:

Virtualization has become a crucial aspect of modern IT infrastructures due to its numerous
benefits. It allows organizations to maximize resource utilization, improve flexibility and
scalability, enhance disaster recovery capabilities, and reduce overall costs. The ability to
create and manage virtual machines efficiently enables IT departments to streamline
operations, increase agility, and adapt to changing business needs more effectively.
Additionally, virtualization facilitates better utilization of hardware resources, leading to
improved energy efficiency and reduced environmental impact. Overall, virtualization plays
a vital role in optimizing IT environments and supporting business growth and innovation.

Quiz:
1. What is the primary software component responsible for managing virtual
machines and their access to the physical hardware?
Answer: The primary software component responsible for managing virtual
machines and their access to the physical hardware is the hypervisor.

2. Name the two types of hypervisors.


Answer: The two types of hypervisors are Type 1 (Bare Metal) and Type 2 (Hosted)
hypervisors.

3. Why might an organization opt to use virtualization in their data center?


Answer: An organization might opt to use virtualization in their data center for
reasons such as resource efficiency, isolation, snapshot and cloning capabilities,
flexibility in testing, and cost savings in hardware procurement and energy
consumption.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010
Experiment No: 20

Aim: Study the concepts and functionalities of Hypervisors, focusing on


VMWare ESXi, Microsoft Hyper-V, Xen Server, and the Java Virtual Machine.

Date:

Competency and Practical Skills:


1. Understand the foundational principles and types of hypervisors.
2. Recognize the features, advantages, and potential use cases of VMWare ESXi,
Microsoft Hyper-V, and Xen Server in virtualized environments.
3. Understand the JVM's role in executing Java applications and its importance in
platform-independent computing.
4. Compare and contrast the functionalities of different hypervisors and the JVM.

Relevant CO: Describe and analyze the memory management and its allocation
policies.

Objectives:
1. To familiarize students with the realm of virtualization and the role of hypervisors in
creating and managing virtual environments.
2. To introduce the features and functionalities of VMWare ESXi, Microsoft Hyper-V, and Xen
Server, enabling informed decision-making in IT infrastructures.
3. To impart the knowledge of the Java Virtual Machine's workings and its importance in the
Java ecosystem.
4. To encourage the exploration and comparison of various virtualization technologies,
understanding their strengths, weaknesses, and use cases.

Equipment/Software: PC/Laptop, Windows Operating System, Installation file of Linux OS

Theory:
1. Hypervisors:
- A hypervisor, often termed a Virtual Machine Monitor (VMM), is software, firmware, or
hardware that creates and runs virtual machines. It divides the host system's resources to
allocate them to the VMs.

2. VMWare ESXi:
- VMWare ESXi is a Type 1 hypervisor integrated into VMware's vSphere suite. It's a bare-
metal hypervisor that installs directly onto the physical server and doesn't require an
underlying operating system.
- It offers centralized management, automation, and scalability capabilities.

3. Microsoft Hyper-V:
- Microsoft Hyper-V is a hypervisor-based virtualization system, part of Windows Server
editions. It's available both as a standalone product and an integrated feature of the
Windows OS.
- Hyper-V can create both VMs and containers, offering robustness and flexibility for
different virtualization needs.

240163116010
4. Xen Server:
- Xen is an open-source Type-1 or bare-metal hypervisor, initially developed by the
University of Cambridge and now hosted by the Linux Foundation.
- Xen is used by many cloud providers and offers features like live migration, VM cloning,
and a high level of security.

5. Java VM (JVM):
- The JVM is a virtualization engine for running Java bytecode. It isn't a hypervisor in the
same sense as the others listed but acts as a virtual machine that provides a runtime
environment to execute Java applications.
- Java applications are compiled into bytecode, which is executed by the JVM. This allows
Java applications to be platform-independent, adhering to the "write once, run anywhere"
(WORA) principle.

Conclusion: Hypervisors like VMWare ESXi, Microsoft Hyper-V, and Xen Server are crucial
for optimizing resource usage and enhancing IT infrastructure flexibility. Each has unique
features catering to various virtualization needs.The Java Virtual Machine (JVM) plays a
pivotal role in Java's platform independence, executing bytecode across different platforms
seamlessly.Understanding these technologies is essential for efficient resource management
and application deployment in modern IT environments.

Quiz:
1. Which of the mentioned hypervisors is integrated into VMware's vSphere suite?
Answer: VMWare ESXi is integrated into VMware's vSphere suite.

2. What distinguishes the Java Virtual Machine from hypervisors like ESXi and Hyper-
V?
Answer: The Java Virtual Machine (JVM) is distinct from hypervisors like ESXi and
Hyper-V as it executes Java bytecode rather than creating and managing virtual
machines.

3. Why is the JVM crucial for Java's "write once, run anywhere" principle?
Answer: The JVM is crucial for Java's "write once, run anywhere" principle because
it abstracts the underlying hardware and operating system details, allowing Java
applications to be platform-independent.

Suggested Reference:

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

240163116010

You might also like