Yogesh Final Klss 11
Yogesh Final Klss 11
BACHELOR OF TECHNOLOGY
III SEMESTER
Laboratory Manual
Session:2024-25
CERTIFICATE
Head Of Department:...........................................
KALI LINUX AND SHELL SCRIPTING PRACTICAL BOOK
COMPUTER SCIENCE & ENGINEERING DEPARTMENT
PREFACE
It gives us immense pleasure to present the first edition of the KALI LINUX AND
SHELL SCRIPTING Practical Book for the B.Tech . 3rd semester students for
PARUL UNIVERSITY.
1. The main objective of the KLSS laboratory is: Learning through the Experimentation. All the
experiments are designed to illustrate various problems in different areas of KLSS and also to expose
the students to various problems and their uses.
2. Be prompt in arriving to the laboratory and always come well prepared for the practical.
3. Every student should have his/her individual copy of the KLSS Practical Book.
4. Every student have to prepare the notebooks specifically reserved for the KLSS practical work: ”
KLSS Practical Book”
5. Every student has to necessarily bring his/her KLSS Practical Book, KLSS Practical Class Notebook
and KLSS Practical Final Notebook.
6. Finally find the output of the experiments along with the problem and note results in the KLSS Practical
Notebook.
7. The grades for the KLSS practical course work will be awarded based on our performance in the
laboratory, regularity, recording of experiments in the KLSS Practical Final Notebook, lab quiz,
regular viva-voce and end-term examination.
Faculty of Engineering & Technology (FET)
Parul Institute of Engineering & Technology (PIET)
Department of Computer Science & Engineering
Description: This practical teaches you how to create a simple shell script to greet
users using variables. In shell scripting, variables store information that scripts can use
and manipulate. This practice helps in understanding the basic usage of variables in
shell scripting and this helps you to build more complex scripts.
WHAT IS SHELL
A shell is a type of computer program called a command-line interpreter that lets Linux
and Unix users control their operating systems with command-line interfaces. Shells
allow users to communicate efficiently and directly with their operating systems.
TYPES OF SHELL
A shell script is a list of commands in a computer program that is run by the Unix
shell which is a command line interpreter. A shell script usually has comments that
describe the steps. The different operations performed by shell scripts are program
execution, file manipulation and text printing. A wrapper is also a kind of shell script
that creates the program environment, runs the program etc.
1. Write a shell script to display a greeting message using variables.
#!/bin/bash
OUTPUT:
2. Create a script that uses loops to print numbers from 1 to 10
#!/bin/bash
#use for loop to print the number
for i in {1..10}
do
echo $i
done
Description:- This practical teaches you how to create a simple shell script to auto-
mate the process of creating multiple directories. In shell scripting, variables store
information that scripts can use and manipulate. This practice helps in understanding the
basic usage of variables in shell scripting and assists you in building more complex
scripts.
Tools:- Kali linux, terminal.
OUTPUT:
Practical 3
Pratical 3
Aim:- Experiment with different ways of executing shell scripts (e.g., ./script.sh, sh
script.sh).
Description:- This practical teaches you how to execute shell scripts using different
methods, including './script.sh' and 'sh script.sh' commands. You will learn how to run
scripts, understand the differences between execution methods, and develop skills to write
more complex scripts. This practice helps you understand the fundamental concepts of
script execution and sets the stage for advanced scripting techniques.
Theory:-
Executing Shell Scripts
There are several ways to execute shell scripts:
➢ ./script.sh: This method is used to execute a script in the current directory. The dot (.)
represents the current directory, and the forward slash (/) is used to separate the directory
from the script name.
➢ sh script.sh: This method is used to execute a script using the sh command. The sh
command is a shell that interprets the script and executes it.
OUTPUT:
Conclusion:- Experimenting with different script execution methods (./script.sh, sh script.sh)
has provided a solid understanding of script execution,
enabling the creation of efficient scripts that automate tasks and simplify system administration.