CS 240, Assignment 05

10 points
Complete by Wednesday, 30.Jan, 01:00 p.m.

Below you are asked to perform various Unix operations, and capture the output to a script file. We have done or discussed most of the neccessary operations in class, and they all are covered in the "Just Enough Unix" textbook.

Before starting scripting, you should review the steps to be sure you know what the correct command is.

Do the following operations as described below, capturing the output to a script file (typescript default is ok) and enscript-ing the resulting file.

  1. start scripting
  2. ensure your are in your current login directory (cd or cd ~)
  3. list the files in your home (top-level) directory using a command which distinguishes between files and directories, as well as showing the dates, size, and protections of the files
  4. list all the files in the directory containing Assignment 02 (the one which printed "Hello your-name .")
  5. list only the files with the .java extension in the directory containing Assignment 02
  6. create a sub-directory off your home directory called practice
  7. copy /academic/cs2/naminghosts to this new directory
  8. show the word count of the naminghosts file
  9. 'cd' to your home directory, and use the same command to list the files that you used in #3 above, except this time redirect the output to a file called dir in your practice sub-directory
  10. do the 'head' and 'tail' commands on the dir file
  11. sort the dir file by file size (skipping leading blanks in the file size field) and redirect the output to a file called dirsize in the practice sub-directory
  12. do a 'cat' on the dirsize file
  13. exit scripting
  14. enscript the typscript file you just created