IT 244: Introduction to Linux/Unix
Answers to Midterm Exam - Odd Columns

  1. What key would you press to get the last command you typed?
    up arrow
  2. What keys would you hit to go to the beginning of the command line?
    Control A
  3. How do you you abort a running program?
    Control C
  4. What is the name of the directory at the top of the Unix filesystem?
    root
  5. What symbol is used to represent the top of the Unix filesystem?
    /
  6. What do you call the directory directly above your current directory?
    the parent directory
  7. What directory are you in when you first log in to a Unix machine?
    your own home directory
  8. By default, which account is the owner of a file or directory?
    the account that created it
  9. Name the three types of access permissions.
    read, write and execute
  10. Name the three categories of accounts which are used in assigning access permissions.
    owner, group, everyone else
  11. Who can change the access permissions on a file or directory?
    only the owner
  12. What does the PATH shell variable contain?
    the list of directories the shell must search 
    to find the file to run a command
  13. What is a process?
    a running program
  14. By default, where does Standard Input come from?
    the keyboard
  15. By default, where does Standard Output go?
    to the screen
  16. Look at the diagram on the last page.
    You are in the directory named it.
    Write the ABSOLUTE pathname for the directory named hw2 under the it244 directory.
    You do not have to write a Unix command, I only want the pathname.
    /courses/it/it244/hw/hw2
  17. Look at the diagram on the last page.
    You are in the directory named courses.
    Write the RELATIVE pathname for the directory named hw1 under the it116 directory.
    You do not have to write a Unix command, I only want the pathname.
    it/it116/hw/hw1
  18. Look at the diagram on the last page.
    You are in the directory named it117.
    Write the RELATIVE pathname for the root directory.
    You do not have to write a Unix command, I only want the pathname.
    ../../..
  19. Look at the diagram on the last page.
    You are in the directory named django under projects.
    Write the RELATIVE pathname for the bob directory under home.
    You do not have to write a Unix command, I only want the pathname.
    ../../home/bob
  20. Look at the diagram on the last page.
    You are in the directory courses.
    Write the command to create a soft link to the it244 directory under the it directory.
    You may use either an absolute or relative pathname.
    ln -s /courses/it244
  21. What would you write on the command line to remove the directory dir1 in your parent directory.
    Assume this directory is empty.
    rmdir ../dir1
  22. What is the name of the only program that can create a process?
    the kernel
  23. Write the command line you would use on back.sh to give all permissions to the owner, read and execute permission to the group and only read permission to everyone else.
    chmod 754 back.sh
  24. Write the command you would use to find all the lines in the file memo.txt that contained the line "rodent" but not "rose".
    grep rodent memo.txt | grep -v rose
  25. Write the command you would use to run finger, but send the output to the file users.txt.
    finger > users.txt