Linux Shell Coding Lab Report
Linux Shell Coding Lab Report
Objective:
The goal of this lab is to gain a foundational understanding of Linux, its command-line interface
(CLI),
and shell scripting. The focus is on exploring Linux file structures, executing essential commands,
Materials Required:
- Terminal access.
Theory:
1. What is Linux?
Linux is a Unix-like, open-source operating system widely used for its stability, flexibility, and
robust CLI.
2. What is a Shell?
The shell is a command-line interpreter that allows users to interact with the OS. Examples include
Page 1
Lab Report: Introduction to Linux and Shell Coding
3. Shell Scripting:
A shell script is a file containing a series of commands executed by the shell. It is used to
Experiment Steps:
Example:
Example:
Example:
Page 2
Lab Report: Introduction to Linux and Shell Coding
4. File Permissions
Example:
1. Creating a Script
#!/bin/bash
- Command: ./hello_world.sh
#!/bin/bash
Page 3
Lab Report: Introduction to Linux and Shell Coding
sum=$((num1 + num2))
Observations:
1. Basic Linux commands are intuitive and effective for file management.
Results:
Conclusion:
This lab provided hands-on experience with Linux commands and shell scripting, enhancing the
understanding of CLI operations and automation. The ability to write scripts to perform calculations
Questions:
Answer: Use the bash -x script.sh command to execute the script in debug mode.
Page 4
Lab Report: Introduction to Linux and Shell Coding
Page 5