Kaushal Khadka LB 7
Kaushal Khadka LB 7
Assessment Type
Logbook 7
Semester
2024/25 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 Comprehensive Workshop on UNIX Utilities For File Operations ............................ 1
1.1 Aim .................................................................................................................... 1
1.2 Objectives ......................................................................................................... 1
1.3 Required tools and concepts............................................................................. 1
1.4 Steps required for lab ........................................................................................ 2
1.5 Conclusion ...................................................................................................... 18
Table of Figures
Figure 1: Creating directory without -p option.................................................................. 2
Figure 2: Displaying created directory structure .............................................................. 2
Figure 3: Creating directory with -p option....................................................................... 2
Figure 4: Displaying directory structure ........................................................................... 3
Figure 5: Changing directory to 1level3 from relative pathname ..................................... 3
Figure 6: Changing directory for practicing 1st command ............................................... 3
Figure 7: Changing directory for practicing 2nd command .............................................. 3
Figure 8: Changing directory for practicing 3rd command ............................................... 3
Figure 9: Changing to 1level3 ......................................................................................... 4
Figure 10: Creating file .................................................................................................... 4
Figure 11: Using ls .......................................................................................................... 4
Figure 12: Copying file .................................................................................................... 4
Figure 13: Showing files are copied ................................................................................ 5
Figure 14: Moving file from 1level3 to 4 level3 ................................................................ 5
Figure 15: Printing text(1) ................................................................................................ 6
Figure 16: Printing text(2) ................................................................................................ 6
Figure 17: Printing text(3) ................................................................................................ 6
Figure 18: ls command -a................................................................................................ 6
Figure 19: ls command -d................................................................................................ 7
Figure 20: ls command -g................................................................................................ 7
Figure 21: ls command -I................................................................................................. 7
Figure 22: All ls commands on w7-2 ............................................................................... 7
Figure 23: ls-l commands from w7-1 ............................................................................... 8
Figure 24: ls commands from w7-1 ................................................................................. 8
Figure 25: ls-a commands from w7-1 .............................................................................. 8
Figure 26: ls-d commands from w7-1 .............................................................................. 8
Figure 27:ls-g commands from w7-1 ............................................................................... 8
Figure 28: ls-l commands from w7-1 ............................................................................... 9
Figure 29: All ls commands on w7-1 ............................................................................... 9
Figure 30: All ls commands from home l ....................................................................... 10
Figure 31: All ls commands from home ll ...................................................................... 11
Figure 32: All ls command on 1level3............................................................................ 11
Figure 33: Changing to w7 directory and removing directory and files .......................... 12
Figure 34: Checking directory removed or not .............................................................. 12
Figure 35: Changing to w7-1 ......................................................................................... 12
Figure 36: Dislaying permission .................................................................................... 13
Figure 37: Removing all access permission .................................................................. 13
Figure 38: Reading the file ............................................................................................ 13
Figure 39: Writing on file ............................................................................................... 13
Figure 40: Adding the permission .................................................................................. 14
Figure 41: Writing on file ............................................................................................... 14
Figure 42: Reading file .................................................................................................. 14
Figure 43: Acces permission of 1level3 ......................................................................... 15
Figure 44: Removing all permission .............................................................................. 15
Figure 45: Reading file .................................................................................................. 15
Figure 46: Adding file in 1level3 .................................................................................... 15
Figure 47: Searching for 1level3 ................................................................................... 16
Figure 48: Adding permission ........................................................................................ 16
Figure 49: Displaying permission .................................................................................. 16
Figure 50: Reading file .................................................................................................. 16
Figure 51: Putting a file ................................................................................................. 17
Figure 52: Searching in 1level3 ..................................................................................... 17
NETWORK OPERATING SYSTEM CT5052NT
1.1 Aim
To complete a variety of file and directory activities like creation, navigation,
transformation, and permission management, in order to improve understanding of UNIX
command line programs.
1.2 Objectives
• To learn about and apply the use of basic UNIX commands like chmod, ls, cd, rm,
and mkdir.
• For enchancing the capacity to establish and manage a directory system.
• To successfully modify file permissions
• To find practical implications of relative and absolute pathnames.
1
NETWORK OPERATING SYSTEM CT5052NT
Step 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.
2
NETWORK OPERATING SYSTEM CT5052NT
Step 2: Change to the 1level3 directory by one step using a relative pathname.
Step 3: Practice in changing directories in your directory structure by one command using
relative pathnames, e.g., from 1level3 to 2level3, from 2level3 to 4level3, from 4level3 to
W7, etc. Use names of parent and child directories (‘.’ and ‘..’) as well.
3
NETWORK OPERATING SYSTEM CT5052NT
Step 4: Change to 1level3 and create a text file by any tool (e.g., by cat or cal like last
tutorial).
Step 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.
4
NETWORK OPERATING SYSTEM CT5052NT
Step 6: Movethis file to 4level3. Show that there is this file in 4level3 and there is not in
1level3.
5
NETWORK OPERATING SYSTEM CT5052NT
Step 7: Print the following texts each in one echo or printf command:
● Hello! I can doit
● 5>(20:8)<(30*2)
● Line1 Line 2
a-b, A-B,–, +, , #, $, %, &.
Step 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.
6
NETWORK OPERATING SYSTEM CT5052NT
7
NETWORK OPERATING SYSTEM CT5052NT
8
NETWORK OPERATING SYSTEM CT5052NT
9
NETWORK OPERATING SYSTEM CT5052NT
10
NETWORK OPERATING SYSTEM CT5052NT
11
NETWORK OPERATING SYSTEM CT5052NT
Step 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.
12
NETWORK OPERATING SYSTEM CT5052NT
• Removeall access permissions for this file and display access permissions for this
file.
• Try to write into this file using any utility (e.g., cat with the sign >> append).
13
NETWORK OPERATING SYSTEM CT5052NT
14
NETWORK OPERATING SYSTEM CT5052NT
• Removeall access permissions for the 1level3 directory and display access
permissions for 1level3.
15
NETWORK OPERATING SYSTEM CT5052NT
• Add read, write, and execute access permissions for yourself for the 1level3
directory.
16
NETWORK OPERATING SYSTEM CT5052NT
17
NETWORK OPERATING SYSTEM CT5052NT
1.5 Conclusion
To sum up, this program offers a useful, hands-on implementation to permissions and
Unix filesystem management. Through interactive exercises, students learn how to
manage file systems, establish directories, and adjust file access rights. Through hands-
on experience with commands and permissions, participants develop practical Unix
system administration abilities.
18