Question: bin boot dev etc home lib mnt media opt sbin group passwd zarul chia hello.cpp test project test recent main.cpp OS list.txt sem1 output Lab.txt



bin boot dev etc home lib mnt media opt sbin group passwd zarul chia hello.cpp test project test recent main.cpp OS list.txt sem1 output Lab.txt Legend: directory files + Figure 1 Figure 1 shows a tree hierarchy of directories and files. From this figure, as an administrator (user created during installation), you are required to create user Zarul and Chia. 1. Create new user Zarul. (1.5 marks) 2. Create new user Chia. (1.5 marks) 3. Create a new group software, network and ftmk. (3 marks) 4. Set the primary and secondary groups for Zarul and Chia based on Tablel. (4 marks) Table 1: Users and Group User Primary Group Groups Zarul ftmk software, ftmk network ftmk, network 5. Delete group zarul and chia. (2 marks) Chia Now for each user, create the folders and files accordingly (refer Figure 1). Creating directories and folders for user Chia. 6. Switch to user Chia. 7. Create the directories. (2 marks) 8. Create the files. (2 marks) 9. Log out from user Chia (hint: type exit). Creating directories and folders for user Zarul. 10. Switch to user Zarul. 11. Create the directories. (3 marks) 12. Create the files. (4 marks) Currently you are in Zarul's home directory. Through answering the questions, your present working directory might change accordingly. 13. Display the 5 lines of file group and redirect the output to file seml. (2 marks) 14. Change directory to project. 15. Create a softlink named Lab-slink for file Lab.txt. (2 marks) 16. Create a hardlink named Labl-hlink for file Lab.txt. (2 marks) 17. Change directory back to zarul. 18. Copy file passwd to OS directory. (2 marks) 19. Rename file output to sem2. (2 marks) 20. Change permission for file hello.cpp so that Chia has the permission for read and write. (2 marks) 21. Log out from user zarul. Now you are back to the administrator user. 100.. 110 120 echo taii 14 echo is echo 12 tail 0 10 20. 30 40. 50. 1 #!/bin/bash 2 ip addr show enpOs 3 a echo 4 echo "1.5 marks each for correct user = 3 marks" echo -2 /etc/passwd e echo "1 mark each for correct group 3 marks" s echo "correct configured primary and secondary 4 marks" 10 echo "chia dan zarul group are deleted 2 marks" 11 echo -6 /etc/group 13 echo "two directories and 2 files = 4 marks" ch 16 ls /home/chia/ /home/chia/recent/ 17 echo 1. echo "3 directories and 4 files 7 marks" 19 echo "renamed output to sem2 2 marks" echo "copied passwd into os 2 marks" an 22 ls /home/zarul/ /home/zarul/test/os /home/zarul/project 22 echo 24 echo "redirect 5 lines from group file 2 marks" 25 echo 26 more /home/zarul/project/sem1 23 echo "correct permission for hello.cpp = 2 marks" 29 echo 30 ls -1 /home/zarul/hello.cpp 21 echo 32 echo "correct slink and hlink = 4 marks 32 echo 24 ls -1 /home/zarul/project/Lab* 35 a echo 21 echo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
