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

  1. 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.
    ../../..
  2. Look at the diagram on the last page.
    You are in the directory named courses.
    Write the RELATIVE pathname for the directory named hw2 under the it244 directory.
    You do not have to write a Unix command, I only want the pathname.
    it/it244/hw/hw2
  3. By default, which account is the owner of a file or directory?
    the account that created it
  4. By default, where does Standard Error go?
    to the screen
  5. What symbol is used to represent the top of the Unix filesystem?
    /
  6. What directory is the starting point for EVERY absolute path?
    the root directory
  7. What does a program do just before it stops running?
    it sends an exit status to the shell
  8. What is the name of the directory at the top of the Unix filesystem?
    root
  9. What would you type at the command line if you wanted to see the value of the variable SHELL?
    echo  $SHELL
  10. By default, where does Standard Output go?
    to the screen
  11. What does the PATH shell variable contain?
    the list of directories the shell must search 
    to find the file to run a command
  12. What directory is the starting point for a relative path?
    the current directory
  13. Look at the diagram on the last page.
    You are in the directory named courses.
    Write the ABSOLUTE pathname for the directory named hw1 under the it116 directory.
    You do not have to write a Unix command, I only want the pathname.
    /courses/it/it116/hw/hw1
  14. Using REDIRECTION, create a duplicate of the file memo.txt called memo.bak. DO NOT use the copy command.
    cat memo.txt > memo.bak
  15. What is the name of the only program that can create a process?
    the kernel
  16. Write the command line you would use on the file notes.txt to give read and write permission to the owner, read permission to the group and no permission to everyone else.
    chmod 640 notes.txt
  17. If you started typing the name of a file on the command line and wanted Unix to supply the rest, what would you do?
    hit the Tab key
  18. Look at the diagram on the last page.
    You are in the directory named test under projects.
    Write the RELATIVE pathname for the gh directory under home.
    You do not have to write a Unix command, I only want the pathname.
    ../../home/gh
  19. Name the three types of access permissions.
    read, write and execute
  20. What do you call a text file containing Unix commands that is run just before the shell gives you a prompt?
    a startup file
  21. What is a process?
    a running program
  22. By default, where does Standard Input come from?
    the keyboard
  23. Write the command you would use to find all the lines in the file results.txt that contained "help" but not "apple".
    grep help results.txt | grep -v apple
  24. Look at the diagram on the last page.
    You are in the directory courses.
    Write the command to create a soft link to the it117 directory under the it directory.
    You may use either an absolute or relative pathname.
    ln -s it/it117
  25. Write the command line you would use on the directory memos to give all permissions to the owner, the ability to run ls to the group and the ability to cd into the directory to everyone else.
    chmod 741 memos