2022 Ct505ni LB7 21049598 C10
2022 Ct505ni LB7 21049598 C10
Assessment Type
Logbook 6
Semester
2022 Spring/Autumn
I confirm that I understand my coursework needs to be submitted online via Google Classroom under
the relevant module page before the deadline in order for my assignment to be accepted and marked.
I am fully aware that late submissions will be treated as non-submission and a mark of zero will be
awarded.
Table of Contents
1 LAB title: 1
2 AIM 1
3 Objective 1
4.2 Shell 2
4.3 Interpreter 2
4.4 Path 3
5.1.1 Question 1 4
5.1.2 Question 2 6
5.1.3 Question 3 7
5.1.4 Question 4 8
5.1.5 Question 5 9
5.1.6 Question 6 11
5.1.7 Question 7 12
5.1.8 Question 8 13
5.1.9 Question 9 17
5.1.10 Question 10 19
5.1.11 Question 11 22
6 Conclusion 24
7 References 25
8 Script 26
Table of Figures
Figure 1: Question 1(a) 4
Figure 2: Question 1(b) 5
Figure 3: Question 2 6
Figure 4: Question 3 7
Figure 5: Question 4 8
Figure 6: Question 5(a) 9
Figure 7: Question 5(b) 9
Figure 8: Question 5(c) 10
Figure 9: Question 5(d) 10
Figure 10: Question 6 11
Figure 11: Question 7 12
Figure 12: Question 8(a) 13
Figure 13: Question 8(b) 14
Figure 14: Question 8(c) 15
Figure 15: Question 8(d) 16
Figure 16: Question 9(a) 17
Figure 17: Question 9(b) 18
Figure 18: Question 9(c) 18
Figure 19: Question 10(a) 19
Figure 20: Question 10(b) 20
Figure 21: Question 10(c) 20
Figure 22: Question 10(d) 21
Figure 23: Question 11(a) 22
Figure 24: Question 11(b) 23
1 LAB title:
The purpose of this week's logbook is to use Kali Linux to learn and use the
fundamental commands and syntaxes of the Linux operating system.
● recognizing Linux.
● recognizing fundamental syntaxes and commands.
● carrying out syntaxes and commands.
.
3 Required tools and concepts
3.1 Kali Linux
Backtrack Linux was the previous name for Kali Linux. Kali Linux is a
debian-based open source Linux that is designed for sophisticated penetration
testing and security auditing. It gives the user standard tools, configurations,
and automations so they may concentrate on their task. All users can easily
access the multi-platform solution Kali Linux.(gOtmi!k, 2022).
3.2 Shell
The command line interpreter for Linux is called the shell. The most widely
used UNIX shell is bash, and the user types the command into the application.
It carries out commands and serves as an interface between the user and the
operating system. For instance, the shell will run the ls command if a user types
ls.
3.3 Interpreter
With the aid of an interpreter, a user can communicate with a program by typing
commands as lines of text. An interpreter runs in a straightforward loop: it
accepts a command, interprets it, executes it, and then waits for more.
4 Steps Required for lab
4.1 Commands in Linux
4.1.1 Question 1
Create the directory structure presented in the figure below. Use mkdir
command and relative pathnames from your home directory. Try both: no
option and –p option, for the command.
Starting script for saving all the commands entered in the time being.
Figure 2: Question 1(b)
Using command “mkdir” to create directories using command “tree” to view all the
directories.
4.1.2 Question 2
Figure 3: Question 2
Figure 4: Question 3
By using "." and ".." symbols, you can change directories using the command
"cd".
4.1.4 Question 4
Using any tool, create a text file (1level3) (for example, cat or cal like in the
previous tutorial).
Figure 5: Question 4
To create a text file, go to directory 1level3 and run the command “cat ”.
4.1.5 Question 5
Copy this text file from 1level3 to 1level3 (with the name file1), 2level3, and
to 3level3 changing its name. Show that there are these files in corresponding
directories.
Going to folder 2level3 and checking if the file we previously copied is in the
folder.
Copying file in the respective folder and checking if the file has been copied or
not.
4.1.6 Question 6
Move this file to 4level3. Show that there is this file in 4level3 and there is not
in 1level3.
Moving the file permanently and checking if the file has been moved from
previous destination to new one.
4.1.7 Question 7
Print the following texts each in one echo or
printf command:
● Hello! I can do it
● Line 1 Line 2
● a-b, A-B, –, +, <, >, #, $, %, &.
Printing the texts shown above with the help of command “echo”.
4.1.8 Question 8
Give the ls command (without options and with a, d, g, l, R options) in home
directory, w7, w7-1, and 1level3 directories. Explain for yourself the results
received.
In the above pictures we can see the use of different commands using ls. Where ls
lists all the folders and files in the directory. “ls –a” shows the invisible files of the
folder. “ls -d” shows information about files and directories within the file system. “ls
-l” shows the permission given to the file or folder. While “ls -R” lists the contents of
your current working directory.
4.1.9 Question 9
Change to the W7 directory. Remove the directory files w7-2, 3level-3,
4level3 and all ordinary files in them. Use the option –i of the rm and rmdir
commands. Show that there are not these ordinary and directory files in your
file structure.
In the above pictures files and folders were removed one after another with
the help of commands rmdir and rm. Command “tree” was used to check if the
files were deleted or not.
4.1.10 Question 10
Displaying the permissions for file1 in the folder 1level3 and removing all
access for the file to read and write.
Figure 20: Question 10(b)
Using command “cat” to write in the file. But the permission is denied as the
permission was removed previously.
After giving permission to file1.txt, we can now read the file as well as write in
the file using command cat
4.1.11Question 11
Displaying the permission granted to 1level3 directory and removing all the
permission for 1level3 directory.
Figure 24: Question 11(b)
Writing into the file1.txt of the directory 1level3 and creating new file name
file2.txt. After that using command ls to look for files.
5 Conclusion
The logbook we were required to complete this week was very similar to the
notebook we completed previously. To finish the logbook, we had to utilize
commands from Linux.
We had to conduct study on a variety of subjects, including Kali Linux, the shell,
the interpreter, invisible files, and many more. This logbook piqued my curiosity
because it contained several novel commands that I was keen to learn more
about. We learned about the different commands used by the Linux operating
system, such as those used to create file directories, write and read files, grant
and revoke permissions. The experience was excellent; I had few issues
keeping this diary because the Linux OS was just getting started and it was
simple.
At last I would like to thanks my teacher, Pratik Karki for guiding us throughout
the logbook. Thanks to his explanation we were able to easily understand the
idea of servers. And with the help of lecture, tutorial and workshop files, we were
able to do this logbook smoothly.
6 References
gOtmi!k, 2022. What is Kali Linux. [Online]
Available at: https://www.kali.org/docs/introduction/what-is-kali-linux/
[Accessed 1 12 2022].
7 Script
┌──(aayam㉿DESKTOP-VNNP6P0)-[~]
└─$ mkdir W9
┌──(aayam㉿DESKTOP-VNNP6P0)-[~]
└─$ cd W9
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ mkdir w7
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ ls
w7
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ tree
└── w7
├── w7-1
└── w7-2
├── 3level3
└── 4level3
7 directories, 0 files
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ cd w7/w7-1/1level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ cd ../2level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/2level3]
└─$ cd ../../w7-2/4level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-2/4level3]
└─$ cd ../../../
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ cd w7/w7-1/1level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls
demo.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls
demo.txt file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ cd ../2level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/2level3]
└─$ ls
file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/2level3]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/2level3]
└─$ cd ../../w7-2/3level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-2/3level3]
└─$ ls
file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-2/3level3]
└─$ cd ../../w7-1/1level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls
demo.txt file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls
demo.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls ../../w7-2/4level3
file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
Hello! I can do it
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
5>(20:8)<(30*2)
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
Line 1
Line 2
a-b,A-B,-,+,<,>,#,$,%,&.
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ cd ../../../
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ pwd
/home/aayam/W9
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ ls
w7
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ ls -a
. .. w7
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ ls -d
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ ls -g
total 4
└─$ ls -R
.:
w7
./w7:
w7-1 w7-2
./w7/w7-1:
1level3 2level3
./w7/w7-1/1level3:
demo.txt
./w7/w7-1/2level3:
file1.txt
./w7/w7-2:
3level3 4level3
./w7/w7-2/3level3:
file1.txt
./w7/w7-2/4level3:
file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]
└─$ cd w7
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ pwd
/home/aayam/W9/w7
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ ls
w7-1 w7-2
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ ls -a
. .. w7-1 w7-2
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ ls -d
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ ls -g
total 8
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ ls -l
total 8
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ ls -R
.:
w7-1 w7-2
./w7-1:
1level3 2level3
./w7-1/1level3:
demo.txt
./w7-1/2level3:
file1.txt
./w7-2:
3level3 4level3
./w7-2/3level3:
file1.txt
./w7-2/4level3:
file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ cd w7-1
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ pwd
/home/aayam/W9/w7/w7-1
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls
1level3 2level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -a
. .. 1level3 2level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -d
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -g
total 8
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -l
total 8
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -R
.:
1level3 2level3
./1level3:
demo.txt
./2level3:
file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ cd 1level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ pwd
/home/aayam/W9/w7/w7-1/1level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls
demo.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls -a
. .. demo.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls -d
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls -g
total 4
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls -l
total 4
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls -R
.:
demo.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ cd ../../
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ rm -i w7-2/3level3/file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ tree
├── w7-1
└── w7-2
└── 4level3
└── file1.txt
5 directories, 3 files
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ tree
├── w7-1
└── w7-2
4 directories, 2 files
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ tree
└── w7-1
├── 1level3
└── 2level3
└── file1.txt
3 directories, 2 files
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ cd w7-1
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ pwd
/home/aayam/W9/w7/w7-1
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -l 1level3/file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls
1level3 2level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ cd 1level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ ls
demo.txt file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]
└─$ cd ../../
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ cd w7-1
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ pwd
/home/aayam/W9/w7/w7-1
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -l 1level3/file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -l 1level3/file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -l 1level3/file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ cat >> 1level3/file1.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -l 1level3
total 8
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -l 1level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls -l 1level3
total 8
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls 1level3
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ ls 1level3/file2.txt
1level3/file2.txt
┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$
exit