Assignment 4

Due: Friday, September 24, 2004 before 2:00pm.

Instructions: Execute the list of commands in a UNIX shell, logging the results to a typescript file. Rename that typescript file hw4.txt and email it to me as an attachment. Feel free to issue commands that are not listed here if they will help you, for example, pwd.
  1. Issue the script command to begin logging your commands to a typescript file.
  2. Create a new directory for this assignment. I will refer to this directory that you create as hw4dir for the remainder of Part 1
  3. Change directories to hw4dir.
  4. Create three empty files in hw4dir and call them file1, file2, and file3
  5. Do a long directory listing.
  6. Archive files file1, file2, and file3 using the tar command. Name the tar file files.tar
  7. Do a long directory listing.
  8. Compress your tar file (files.tar) using the gzip command
  9. Do a long directory listing.
  10. Create a directory named subdir in hw4dir
  11. Move the file files.tar.gz to subdir
  12. Change directories to subdir
  13. Do a long directory listing.
  14. Unzip files.tar.gz using the gunzip command
  15. Do a long directory listing.
  16. Unpack the files in files.tar using the tar command.
  17. Do a long directory listing.
  18. Remove all files in subdir, and change directories to hw4dir
  19. Use the echo command to create a file named foo that contains the text: hello world!
  20. Display the contents of the file foo
  21. Do a long directory listing.
  22. Change the file permissions for the file foo so that the user does not have read or write permissions. That means, the permissions should be changed to "----------"
  23. Do a long directory listing.
  24. Try to display the contents of the file foo
  25. Give read and write permissions for file foo back to the user, and do a long directory listing.
  26. Now display the contents of the file foo
  27. Change directories to subdir.
  28. Create a symbolic link to the file foo from hw4dir, and call it foolink
  29. Do a long directory listing, and then display the contents of foolink
  30. Remove the file foo in hw4dir
  31. Now display the contents of foolink
  32. Remove foolink
  33. Remove the directory subdir
  34. Exit the script, and rename the typescript file hw4.txt
  35. Display the contents of hw4.txt to make sure everything is there.
Now, email me hw4.txt as an attachment. bill@coral-lab.org is my email address. Again, the assignment is due before our last class, that is, Friday, September 24th, before 2pm.