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

  1. How do you you abort a running program?
    Control C
  2. What would you type at the command line if you wanted to see the value of the variable SHELL?
    echo  $SHELL
  3. 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
  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 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. By default, which account is the owner of a file or directory?
    the account that created it
  10. Name the three types of access permissions.
    read, write and execute
  11. Name the three categories of accounts which are used in assigning access permissions.
    owner, group, everyone else
  12. Who can change the access permissions on a file or directory?
    only the owner
  13. What does the PATH shell variable contain?
    the list of directories the shell must search 
    to find the file to run a command
  14. What is a process?
    a running program
  15. What does a program do just before it stops running?
    it sends an exit status to the shell
  16. Look at the diagram on the last page.
    You are in the directory named it.
    Write the ABSOLUTE pathname for the directory named hw1 under the it117 directory.
    You do not have to write a Unix command, I only want the pathname.
    /courses/it/it117/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 it116.
    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 gh under home.
    Write the RELATIVE pathname for the test directory under projects.
    You do not have to write a Unix command, I only want the pathname.
    ../../projects/test
  20. Look at the diagram on the last page.
    You are in the directory gh.
    Write the command to create a soft link to the django directory under the projects directory.
    You may use either an absolute or relative pathname.
    ln -s /projects/django
  21. Write the command line you would use on notes.txt to give all permissions to the owner, read permission to the group and no permission to everyone else.
    chmod 740 notes.txt
  22. What is the name of the only program that can create a process?
    the kernel
  23. Write the command you would use to run who but send the output to the file listing.txt.
    who > listing.txt
  24. Write the command you would use to find all the lines in the file results.txt that contained the line "nature" but not "bird".
    grep nature results.txt | grep -v bird
  25. What would you write on the command line to remove the directory dir1 in your parent directory.
    Assume this directory is empty.
    rmdir ../dir1