Question
I need the script file for this problem! 1. Login to UNIX as an ordinary user. 2. Use script to create a file named ch4
I need the script file for this problem!
1. Login to UNIX as an ordinary user.
2. Use script to create a file named ch4
3. Run the date command.
4. Create a directory named temp (mkdir temp)
5. Create a file in temp named test 1 (echo date>temp/test1)
6. A directory listing shows that the user, thats you, has read, write and execute privileges on the
directory temp (ls il)
7. A directory listing of temp shows that the user has read and write permissions on test1 (ls il temp)
8. You can see the contents of test1 because you have read permissions (cat temp/test1). At this point we know we have a directory named temp that contains a file named test1, and that the contents of test1 are the word date.
9. Now, lets remove the users read permissions on the directory, temp. (chmod u-r temp). A
listing will prove that user has only write and execute privileges on temp (ls il).
10. If we try to view the contents of temp, permission is denied (ls temp). We cannot see the directory listing because we do not have read permissions, but we know it is still there.
11. Can we still read the file test1? We know where the file is and we have execute privileges on the directory so we can still navigate to it even though we cant see that it exists. (cat temp/test1)
12. Can we update the file test1? We know where the file is. We have write permissions on the file.
And, we can navigate to the file with execute privileges on the directory that contains the file. So, we should be able to update the file. (echo date >> temp/test1). test1 now contains date date. (cat temp/test1)
13. Can we create a copy of the file test1 in temp? We have read permissions on the file, so we can copy it. We have write permissions on the directory, temp, so we should be able to copy the file. (cp temp/test1 temp/test2)
14. Now lets give the user back the read permissions on temp and take the execute privileges away.
(chmod u+r temp; chmod u-x temp)
15. Can we view the contents of the temp directory? (ls temp)
16. Can we view the attributes of files in the temp directory? (ls il temp)
17. Can we read the file test1? (cat temp/test1)
18. Can we update the file test1? (echo date >> temp/test1)
19. Can we create a copy of test1 in temp? (cp temp/test1 temp/test3)
20. Now lets give back execute privileges on temp and take away write privileges (chmod u+x temp;
chmod u-w temp).
21. Can we read the file test1? (cat temp/test1)
22. Can we update the file test1? (echo date >> temp/test1)
23. Can we create a copy of test1 in temp? (cp temp/test1 temp/test3)
24. Now, lets give back write permissions on temp (chmod u+w temp), and take write permissions
from test1 (chmod u-w temp/test1).
25. Can we update temp/test1? (echo date >> temp/test1)
26. Can we copy temp/test1 to temp/test3? (cp temp/test1 temp/test3).
27. Can we delete temp/test1 without overriding protection? (rm temp/test1)
28. find a.out file under /export directory through all subdirectories (find /export name a.out print)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started