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

  1. What would you type at the command line if you wanted to see the value of the variable SHELL?
    echo  $SHELL
  2. 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
  3. What is the name of the directory at the top of the Unix filesystem?
    root
  4. What symbol is used to represent the top of the Unix filesystem?
    /
  5. By default, which account is the owner of a file or directory?
    the account that created it
  6. What do you call a text file containing Unix commands that is run just before the shell gives you a prompt?
    a startup file
  7. What directory is the starting point for EVERY absolute path?
    the root directory
  8. What directory is the starting point for a relative path?
    the current directory
  9. Name the three types of access permissions.
    read, write and execute
  10. What does the PATH shell variable contain?
    the list of directories the shell must search 
    to find the file to run a command
  11. What is a process?
    a running program
  12. What does a program do just before it stops running?
    it sends an exit status to the shell
  13. By default, where does Standard Input come from?
    the keyboard
  14. By default, where does Standard Output go?
    to the screen
  15. By default, where does Standard Error go?
    to the screen
  16. 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
  17. 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
  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 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
  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 it117 directory under the it directory.
    You may use either an absolute or relative pathname.
    ln -s it/it117
  21. Using REDIRECTION, create a duplicate of the file memo.txt called memo.bak. DO NOT use the copy command.
    cat memo.txt > memo.bak
  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 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
  24. 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
  25. 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