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

Assignment 2

Uploaded by

cheiikh2rad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Assignment 2

Uploaded by

cheiikh2rad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

SMARTBRIDGE EXTERNSHIP

(Cyber Threat Intelligence (Cyber Security & Ethical


Hacking))

NAME: PRANAV DATT

REG.NO: 20BCE2722

CAMPUS :VIT Vellore University

Assignment: Bash Shell Basics

Task 1: File and Directory Manipulation

1. Create a directory called "my_directory".


2. Navigate into the "my_directory".

3. Create an empty file called "my_file.txt".


4. List all the files and directories in the current directory.

5. Rename "my_file.txt" to "new_file.txt".

6. Display the content of "new_file.txt" using a pager tool of your choice.

7. Append the text "Hello, World!" to "new_file.txt".

8. Create a new directory called "backup" within "my_directory".


9. Move "new_file.txt" to the "backup" directory.

10. Verify that "new_file.txt" is now located in the "backup" directory.

11. Delete the "backup" directory and all its contents.

Task 2: Permissions and Scripting

● Create a new file called "my_script.sh".

● Edit "my_script.sh" using a text editor of your choice and add the following lines:

bash

#!/bin/bash

echo "Welcome to my script!"

echo "Today's date is $(date)."

Save and exit the file.

● Make "my_script.sh" executable.


● Run "my_script.sh" and verify that the output matches the expected result.

Task 3: Command Execution and Pipelines

● List all the processes running on your system using the "ps" command.
● Use the "grep" command to filter the processes list and display only the processes with "bash" in
their name.

● Use the "wc" command to count the number of lines in the filtered output.

You might also like