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

2022 Ct505ni LB7 21049598 C10

This logbook document summarizes the completion of lab exercises using basic commands and syntax in Kali Linux. The document outlines objectives to recognize Linux, fundamental syntaxes and commands, and carry out related tasks. Steps provide instructions and screenshots for 11 questions involving directory navigation and manipulation, file creation, copying, moving, removal, and permission changes using commands like mkdir, cd, ls, rmdir, rm, and chmod.
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)
38 views

2022 Ct505ni LB7 21049598 C10

This logbook document summarizes the completion of lab exercises using basic commands and syntax in Kali Linux. The document outlines objectives to recognize Linux, fundamental syntaxes and commands, and carry out related tasks. Steps provide instructions and screenshots for 11 questions involving directory navigation and manipulation, file creation, copying, moving, removal, and permission changes using commands like mkdir, cd, ls, rmdir, rm, and chmod.
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/ 53

Module Code & Module Title

Level 5 – Network Operating Systems

Assessment Type

Logbook 6

Semester

2022 Spring/Autumn

Student Name: Smriti Swar

London Met ID: 21049467

College ID: np01cp4a210117

Assignment Due Date: 9 th December, 2022


Assignment Submission Date: 9th December, 2022

Submitted To: Pratik Karki

Word Count (Where Required): 2133

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 Required tools and concepts 2

4.1 Kali Linux 2

4.2 Shell 2

4.3 Interpreter 2

4.4 Path 3

4.5 Invisible files 3

4.6 Command Syntax 3

5 Steps Required for lab 4

5.1 Commands in Linux 4

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:

Execute basic commands and syntax in Kali Linux.

2 AIM AND OBJECTIVE

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.

The following is a list of the logbook's goals:

● 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. 

Figure 1: Question 1(a)

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

Using a relative pathname, change to 1level3.

Figure 3: Question 2

Using the "cd" command to change directories.


4.1.3 Question 3

You can practice changing directories using relative pathnames by one


command, e.g., 1level3 to 2level3, 2level3 to 4level3, 4level3 to W7, etc. Use
names of parent and child directories (‘.’ and ‘..’) as well.

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.

Figure 6: Question 5(a)

In the same folder as file1.txt, copy demo.txt.

Figure 7: Question 5(b)

Copying file1.txt to another folder name 2level3.


Figure 8: Question 5(c)

Going to folder 2level3 and checking if the file we previously copied is in the
folder.

Figure 9: Question 5(d)

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.

Figure 10: Question 6

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

> (20: 8) < (30 * 2)

● Line 1 Line 2
● a-b, A-B, –, +, <, >, #, $, %, &.

Figure 11: Question 7

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.

Figure 12: Question 8(a)


Figure 13: Question 8(b)

Figure 14: Question 8(c)


Figure 15: Question 8(d)

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.

Figure 16: Question 9(a)


Figure 17: Question 9(b)

Figure 18: Question 9(c)

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

Figure 19: Question 10(a)

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.

Figure 21: Question 10(c)

Giving “file1.txt” permission to read and write.


Figure 22: Question 10(d)

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

Figure 23: Question 11(a)

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

Script started on 2022-12-07 20:19:48+05:45 [TERM="xterm-256color"


TTY="/dev/pts/0" COLUMNS="92" LINES="39"]

┌──(aayam㉿DESKTOP-VNNP6P0)-[~]

└─$ mkdir W9

┌──(aayam㉿DESKTOP-VNNP6P0)-[~]

└─$ cd W9

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]

└─$ mkdir w7

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]

└─$ mkdir w7/w7-1 w7/w7-2

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]

└─$ mkdir w7/w7-1/1level3 w7/w7-1/2level3 w7/w7-2/3level3 w7/w7-2/4level3

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]

└─$ ls
w7

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]

└─$ tree

└── w7

├── w7-1

│   ├── 1level3

│   └── 2level3

└── 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]

└─$ cat > demo.txt

This is first line

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]

└─$ ls

demo.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]

└─$ cp demo.txt file1.txt


┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]

└─$ ls

demo.txt file1.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]

└─$ cp file1.txt ../2level3

┌──(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]

└─$ cp file1.txt ../../w7-2/3level3

┌──(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]

└─$ mv file1.txt ../../w7-2/4level3

┌──(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]

└─$ echo "Hello! I can do it"

Hello! I can do it

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]

└─$ echo "5>(20:8)<(30*2)"

5>(20:8)<(30*2)

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]

└─$ echo -e "Line 1\n Line 2\n a-b,A-B,-,+,<,>,#,$,%,&."

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

drwxr-xr-x 4 aayam 4096 Dec 7 20:20 w7


┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9]

└─$ 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

drwxr-xr-x 4 aayam 4096 Dec 7 20:21 w7-1

drwxr-xr-x 4 aayam 4096 Dec 7 20:21 w7-2

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]

└─$ ls -l

total 8

drwxr-xr-x 4 aayam aayam 4096 Dec 7 20:21 w7-1

drwxr-xr-x 4 aayam aayam 4096 Dec 7 20:21 w7-2

┌──(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

drwxr-xr-x 2 aayam 4096 Dec 7 20:26 1level3

drwxr-xr-x 2 aayam 4096 Dec 7 20:24 2level3

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ ls -l

total 8

drwxr-xr-x 2 aayam aayam 4096 Dec 7 20:26 1level3

drwxr-xr-x 2 aayam aayam 4096 Dec 7 20:24 2level3

┌──(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

-rw-r--r-- 1 aayam 19 Dec 7 20:23 demo.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1/1level3]

└─$ ls -l

total 4

-rw-r--r-- 1 aayam aayam 19 Dec 7 20:23 demo.txt

┌──(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

rm: remove regular file 'w7-2/3level3/file1.txt'? y


┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]

└─$ rmdir w7-2/3level3

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]

└─$ tree

├── w7-1

│   ├── 1level3

│   │   └── demo.txt

│   └── 2level3

│   └── file1.txt

└── w7-2

└── 4level3

└── file1.txt

5 directories, 3 files

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]

└─$ rm -ri w7-2/4level3


rm: descend into directory 'w7-2/4level3'? y

rm: remove regular file 'w7-2/4level3/file1.txt'? y

rm: remove directory 'w7-2/4level3'? y

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]

└─$ tree

├── w7-1

│   ├── 1level3

│   │   └── demo.txt

│   └── 2level3

│   └── file1.txt

└── w7-2

4 directories, 2 files

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]

└─$ rmdir w7-2

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7]
└─$ tree

└── w7-1

├── 1level3

│   └── demo.txt

└── 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

ls: cannot access '1level3/file1.txt': No such file or directory


┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ chmod -rwx 1level3/file1.txt

chmod: cannot access '1level3/file1.txt': No such file or directory

┌──(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]

└─$ cp demo.txt file1.txt

┌──(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

-rw-r--r-- 1 aayam aayam 19 Dec 7 20:58 1level3/file1.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ chmod -rwx 1level3/file1.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ ls -l 1level3/file1.txt

---------- 1 aayam aayam 19 Dec 7 20:58 1level3/file1.txt


┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ cat 1level3/file1.txt

cat: 1level3/file1.txt: Permission denied

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ cat >> 1level3/file1.txt

bash: 1level3/file1.txt: Permission denied

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ chmod u=rw 1level3/file1.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ ls -l 1level3/file1.txt

-rw------- 1 aayam aayam 19 Dec 7 20:58 1level3/file1.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ cat 1level3/file1.txt

This is first line

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]
└─$ cat >> 1level3/file1.txt

This demo line 2.

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ cat 1level3/file1.txt

This is first line

This demo line 2.

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ ls -l 1level3

total 8

-rw-r--r-- 1 aayam aayam 19 Dec 7 20:23 demo.txt

-rw------- 1 aayam aayam 37 Dec 7 21:05 file1.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ chmod -rwx 1level3

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ ls -l 1level3

ls: cannot open directory '1level3': Permission denied


┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ chmod u+rmx 1level3

chmod: invalid mode: ‘u+rmx’

Try 'chmod --help' for more information.

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ chmod u+rwx 1level3

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ ls -l 1level3

total 8

-rw-r--r-- 1 aayam aayam 19 Dec 7 20:23 demo.txt

-rw------- 1 aayam aayam 37 Dec 7 21:05 file1.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ cat 1level3/file1.txt

This is first line

This demo line 2.


┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ touch 1level3/file2.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ ls 1level3

demo.txt file1.txt file2.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$ ls 1level3/file2.txt

1level3/file2.txt

┌──(aayam㉿DESKTOP-VNNP6P0)-[~/W9/w7/w7-1]

└─$

exit

Script done on 2022-12-07 21:09:55+05:45 [COMMAND_EXIT_CODE="0"]

You might also like