0% found this document useful (0 votes)
23 views2 pages

Linux Lab Report

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, and writing basic shell scripts to automate tasks.

Uploaded by

pharaohhbosss
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)
23 views2 pages

Linux Lab Report

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, and writing basic shell scripts to automate tasks.

Uploaded by

pharaohhbosss
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/ 2

Linux Lab Report

Title: Basic File Handling, Commenting, Variable Declarations, and Operations on Linux

Name: [Your Name]

Date: [Date]

1. Objective

To explore and understand the fundamental concepts of file handling, commenting, variable

declarations, and basic operations in the Linux environment.

2. Introduction

This section covers the importance of:

- File Handling: Managing files (create, read, write, delete).

- Commenting: Documenting code/scripts for readability.

- Variable Declarations: Storing and manipulating data in scripts.

- Operations: Performing arithmetic and logical tasks.

3. Experiment Setup

- Operating System: [Linux distribution and version, e.g., Ubuntu 22.04]

- Shell Environment: [Bash, Zsh, etc.]

- Tools: Text editors (e.g., Nano, Vim) and terminal commands.

4. Procedure

4.1 File Handling

1. Create a file: touch file.txt

2. Write to a file: echo 'This is a test file' > file.txt

3. Append data: echo 'Appending a new line' >> file.txt

4. Read the file: cat file.txt


5. Delete the file: rm file.txt

4.2 Commenting in Scripts

1. Single-line comments: # This is a single-line comment

2. Multi-line comments: : ' Multi-line comments '

4.3 Variable Declarations

1. Declare a variable: NAME='LinuxLab'

2. Use the variable: echo 'Welcome to $NAME'

4.4 Operations

1. Arithmetic operations:

x=10; y=5; echo 'Sum: $((x + y))'; echo 'Product: $((x * y))'

2. Logical operations:

if [ $x -gt $y ]; then echo '$x is greater than $y'; fi

5. Results

Include screenshots of the commands executed, showing their outputs.

6. Conclusion

Mastering basic file handling, commenting, variable declarations, and operations in Linux is crucial

for efficient system administration and scripting.

7. References

- Official Bash Documentation: https://www.gnu.org/software/bash/manual/

- Linux Command Handbook: https://linuxhandbook.com/

You might also like