0% found this document useful (0 votes)
5 views12 pages

Bsic Linux Commands

The document provides a series of tasks related to file and directory management using various Linux commands. It includes creating directories and files, editing file contents, displaying file content, copying and deleting files, and handling safe file deletion. Additionally, it emphasizes the conditions for removing directories and includes practical scenarios for hands-on practice.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

Bsic Linux Commands

The document provides a series of tasks related to file and directory management using various Linux commands. It includes creating directories and files, editing file contents, displaying file content, copying and deleting files, and handling safe file deletion. Additionally, it emphasizes the conditions for removing directories and includes practical scenarios for hands-on practice.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

mkdir (Create Directories)


Question 1
Create a directory called cyber_lab inside your home directory

Question 2
Inside the cyber_lab directory, create the following subdirectories:

• logs
• scripts
• reports
2. touch (Create Files)
Question 3
Inside the logs directory, create three empty files named:

• [Link]
• [Link]
• [Link]

Question 4
Create a file called [Link] inside the reports directory.

3. nano (Edit Files)


Question 5
Open [Link] using nano and write the following information:

• Your name  The date


• A short description of what Kali Linux is used for.
Save and exit the file.

Question 6
Open [Link] using nano and write a short message explaining what network scanning is.

4. cat (Display File Content)


Question 7
Display the contents of [Link] using the cat command.

Question 8
Display the contents of [Link] and [Link] at the same time using a single command.

5. cp (Copy Files)
Question 9
Copy the file [Link] from the logs directory into the reports directory.

Question 10
Copy all files from the logs directory into the scripts directory.

6. trash-cli (Safe File Deletion)


Question 11
Install trash-cli and move the file [Link] to the trash instead of permanently deleting it.
Question 12
List all files currently in the trash.

7. rm (Remove Files)
Question 13
Delete the file [Link] from the logs directory.
Question 14
Remove the copied file [Link] from the scripts directory.

8. rm -f (Force Delete)
Question 15
Force delete a file called [Link] inside the scripts directory even if the system asks for

confirmation.
9. rmdir (Remove Empty Directory)
Question 16
Delete the reports directory using rmdir.

What condition must be met before this command works?

10. Combined Practical Scenario


Question 17
Create a directory called pentest_project and inside it create two folders:

• reconnaissance
• exploitation

Create a file called [Link] inside reconnaissance and add three fake target IP addresses using
nano.
Display the contents using cat.
Question 18
Copy [Link] to the exploitation directory and then delete the original file using rm.

Question 19
Create a directory called temp_files and add three files inside it using touch. Delete
the directory using rmdir.
What error occurs and why? Directory empty error occurs. Rmdir has a very strict
rule of deleting only empty files and the temp file created is not empty therefore
deletion is not possible

Question 20
Create a file called [Link], write some text using nano, display the contents using cat, and
then remove it permanently using rm -f.

You might also like