Lecture notes for the Introduction to Computer Science for non-majors by James Tam Return to the course web page

CPSC 217: Assignment 1 (Worth 3%)

Mark out of 28 Letter
28 A
27 A-
25 - 26 B+
23 - 24 B
21 - 22 B-
19 - 20 C+
17 - 18 C
15 - 16 C-
13 - 14 D+
11 - 12 D
  9 - 10 D-
Less than 9 F

New Concepts to be applied for the assignment

Introduction to UNIX: Using common commands (28 marks)

Part I, Learning common UNIX commands. Briefly describe the effect or purpose of each of the following UNIX commands (8 marks):

  1. script       
  2. ls             
  3. pwd         
  4. mkdir       
  5. cd           
  6. rm            
  7. more        
  8. cp            

Part II, Application of these commands. On the UNIX workstations in the Computer Science lab complete the following steps (20 marks):

  1. Login to your UNIX account

  2. Start a script session 

  3. Show the contents of your home directory   

  4. Show your location (path) in the UNIX file system   

  5. Make a new directory called '217'   

  6. Show the contents of your home directory   

  7. Enter the newly created ‘217’ directory   

  8. Show the contents of the newly created ‘217’ directory   

  9. Show your location (path) in the UNIX file system   

  10. Go to the official directory for CPSC 217 (/home/courses/217)   

  11. Show the contents of the CPSC 217 directory   

  12. Show your location (path) in the UNIX file system   

  13. Go to the directory for Assignment 1 (/home/courses/217/assignments/assignment1)   

  14. Show the contents of the Assignment 1 directory   

  15. Show your location (path) in the UNIX file system   

  16. Display the contents of the file called 'index.txt' onscreen.  Show the file one screen a screen at a time (with a prompt for the user to continue) rather than showing the file all at once.  [JT's comment: This step may result in a small amount of 'garbage' or nonsense text appearing on your paper printout.  If the garbage only appears for this step (partway through the display of this file) and/or each of your steps is clear enough for your marker to see each distinct step then you can still get full marks for this assignment.]   

  17. Try to delete the 'index.txt' file [JT's Hint: you aren't supposed to be able to complete this step successfully but instead you should get an error message.]   

  18. Copy the file index.txt to the newly created ‘217’ directory that you created in your home directory    

  19. Go to the 217 directory that is located in your home directory

  20. Show the contents of the ‘217’ directory.  (It should include the file 'index.txt' now.)

  21. End the script session   

  22. Print out the script - it should be saved as a file called ''typescript'.  You can either use the CPSC printers to print out the typescript file or if you prefer you can use the Ssh file transfer program and print it from home.   In order to receive full credit for each step you need to annotate your printout by hand (i.e., use an ink pen or felt pen) to clearly number and label where steps 2 - 21 are listed on the printout.  Hand the printout into the appropriate assignment box for your tutorial – make sure you read the general assignment submission guidelines to make sure that you haven't missed anything!