Lab04 - 29640 - SE 4-1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Name: Muheeb ur Rehman

SAP ID: 29640

Subject: OS Lab

Task: 04

Submission to: Sir Shahzad Ahmad Khan

Date: 14/10/2022
1. Create a blank text file on your home directory with your name.

2. Make a directory with name student.

3. Change the directory to student and copy your text file in this directory.

4. Assign no permission to anyone (use numeric method for permission).

5. Verify that above task has done successfully.

6. Now try to write in this file. If error occurs, state why?

Permission was denied because earlier we had given it no permission and


because of that the file can’t be read, write and executed.

7. Assign permission of write only to user (do it twice by using both symbolic
and numeric methods).
8. Verify that above task has done successfully.

9. Write your introduction in 5 to 7 lines in .txt file.

10. Display contents of the file. If error occurs, state why?

Permission was denied because earlier we had given it only write permission
and because of that the file can’t be read.

11. Assign permission of read only to user (do it twice by using both symbolic
and numeric methods).

12. Verify that above task has done successfully.

13. Display contents of the file.


14. Assign permissions of read and execute only to user (do it twice by using
both symbolic and numeric methods).

15. Verify that above task has done successfully.

16. Assign permissions of read and write only to user (do it twice by using both
symbolic and numeric methods).

17. Verify that above task has done successfully.

18. Assign all permissions to user (do it twice by using both symbolic and
numeric methods).

19. Verify that above task has done successfully.

20. Assign permission of read and execute only to group (do it twice by using
both symbolic and numeric methods).
21. Verify that above task has done successfully.

22. Assign all permissions to all users (do it twice by using both symbolic and
numeric methods).

23. Verify that above task has done successfully.

Show Simulation results after performing the following tasks by


using suitable commands in Linux. Also show
command/commands used for specific task.
1. Create 3 empty text files and name them as students.txt, pstudent.txt and
fstudents.txt.

2. Assign permissions to read only permission to the user (do it twice by using
both symbolic and numeric methods).
3. Enter at least 10 10 different students’ names in pstudent.txt and fstudent.txt.
If any error appears, debug that error for user only.

4. Now create directory named RIPHAH and assign permissions of read only
to user and group (do it twice by using both symbolic and numeric methods).

5. Copy all files to directory RIPHAH. If any error appears, debug that error for
user and group only.
6. After that append the file students.txt with first five sorted names from
pstudent.txt and last five sorted names from fstudent.txt.

7. Show the contents of sorted names from file students.txt.

8. Change the permissions of file students.txt read only and both other files
read and write only (do it twice by using both symbolic and numeric
methods).

9. Now append another student name in student.txt file.

No new name can be appended because the “students.txt” has only read-
only permission.
10. Display contents of all the files.

11. Show permissions and all of the file contents of RIPHAH.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy