0% found this document useful (0 votes)
9 views9 pages

Department of Computer Science and Engineering Operating Structures Lab

The document is a lab file for a Computer Science and Engineering course, detailing various experiments related to Linux OS and shell scripting. It includes objectives, procedures, and basic commands for tasks such as installing VirtualBox, studying Linux architecture, and writing shell scripts. Each experiment is dated and signed, indicating completion and understanding of the material.
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)
9 views9 pages

Department of Computer Science and Engineering Operating Structures Lab

The document is a lab file for a Computer Science and Engineering course, detailing various experiments related to Linux OS and shell scripting. It includes objectives, procedures, and basic commands for tasks such as installing VirtualBox, studying Linux architecture, and writing shell scripts. Each experiment is dated and signed, indicating completion and understanding of the material.
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/ 9

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

OPERATING STRUCTURES LAB

CO 204
LAB FILE

SUBMITTED TO SUBMITTED BY:

Ms. Gull Kaur Vinay


2K22/CO/498
INDEX

S. No. Objective Date Sign


1. To download and install Virtual box, and Linux OS over 9/1/24
virtual machine.
2. To study the Linux architecture and introduction to shell 9/1/24
scripting and explain.
3. Run the basics commands on Linux terminal and explain them. 16/1/24

4. Write Shell Script to find factorial of a number. 23/1/24


5. Write an awk script to find the number of characters, words 23/1/24
and lines in a file.
6. Write a shell script to print date and time and that runs at 8:00 30/1/24
am every day.
EXPERIMENT-1

Objective: To download and install Virtual box, and Linux OS over virtual machine.

System specifications:
● 16Gb RAM, 512 SSD.
● 11th Gen Intel(R) Core (TM) i5-11800H @ 2.30GHz 2.30 GHz
Procedure:
● Open windows powerShell and run command WSL –Install.
● Set up the username and password for Ubuntu.
● After setting up you can run Linux commands.

Remarks:
 Ubuntu was successfully Installed on my computer.
EXPERIMENT-2

Objective: To study the Linux architecture and introduction to shell scripting and explain.
Theory:
Components of LINUX System :

1. Kernel - The kernel is a computer program that is the core of a computer’s operating system, with complete
control over everything in the system. It manages the following resources of the Linux system – File
management, Process management, I/O management, Memory management, Device management etc.

2. Shell - A shell is a special user program that provides an interface for the user to use operating system
services. Shell accepts human-readable commands from users and converts them into something that the
kernel can understand.

Basic commands in Linux:


EXPERIMENT-3

Objective: Run the basic commands on the Linux terminal and explain them.
Commands and Explanation:

● ls: Lists directory contents.


● pwd: Prints the current working directory.
● mkdir: Creates a new directory.
● touch: Creates an empty file or updates the timestamp of an existing file.
● rmdir: Removes a directory (only if it's empty).
● rm: Removes files or directories.
● mv: Moves or renames files or directories.
● uname: Prints system information.
● cat: Displays the contents of a file.
● echo: Prints arguments to the standard output.
● whereis: Locates the binary, source, and manual page files for a command.
● df: Displays disk space usage information.

Output:
EXPERIMENT-4

Objective: Write Shell Script to find factorial of a number.


Theory: If we have a number N, then its factorial is calculated by N*(N-1)*…1.

Shell Script:

Output:
EXPERIMENT-5

Objective: Write an awk script to find the number of characters, words and lines in a file.
Theory: Awk is a scripting language used for manipulating data and generating reports. The awk command
programming language requires no compiling and allows the user to use variables, numeric functions, string
functions, and logical operators.

Code:

Output:
EXPERIMENT-6

Objective: Write a shell script to print the date and time and that runs at 8:00 am every day.
Theory:

Shell Script: The shell script will contain commands to print the current date and time. We'll use the date
command for this purpose.

Cron Job: Cron is a time-based job scheduler in Unix-like operating systems. We'll create a cron job to
schedule the execution of our shell script at 8:00 AM every day.

Code:

Output:

You might also like