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

  1. 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 it117 directory.
    You do not have to write a Unix command, I only want the pathname.
    it/it117/hw/hw2
  2. Write a command that will change the permissions on the FILE named work so that the owner can do anything with the file, the group can read and execute it, and everyone else can only read the file.
    You MUST use numeric arguments.
    chmod  754  work
  3. Name the three categories of accounts which are used in assigning access permissions.
    owner, group, everyone else
  4. Write a command that will change the permission on the DIRECTORY named dir1 so that the owner can see what is in the directory and create files there, the group can see the contents of the directory and everyone else can only cd into the directory. You MUST use numeric arguments.
    chmod  641  dir1
  5. Name the three types of access permissions.
    read, write and execute
  6. By default, which account is the owner of a file or directory?
    the account that created it
  7. 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
  8. What does the PATH shell variable contain?
    the list of directories the shell must search to find the file to run a command
  9. Does the shell check that a program gets the arguments or options it needs?
    no, that is the responsibility of the program itself
  10. Look at the diagram on the last page.
    You are in the directory gh.
    Write the command to create a soft link to the hw2 directory under the it244 directory.
    You may use either an absolute or relative pathname.
    ln -s /courses/it/it244/hw/hw2
  11. If you have read permission on a directory, what can you do in it?
    run ls on the directory to list its contents
  12. What is the name of the only program that can create a process?
    the kernel
  13. By default, where does Standard Error go?
    to the screen
  14. What does a program do JUST BEFORE it stops running?
    it sends an exit status to the shell
  15. 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.
    ../../..
  16. What is the name of the account that can do ANYTHING on a Unix or Linux system?
    root
  17. Write a single command to copy the file memo.txt from your home directory to your current directory.
    cp  ~/memo.txt  .
  18. What is a process?
    a running program
  19. By default, where does Standard Input come from?
    the keyboard
  20. Look at the diagram on the last page.
    You are in the directory named it.
    Write the RELATIVE pathname for the django directory.
    You do not have to write a Unix command, I only want the pathname.
    ../../projects/django
  21. What do you call a text file containing Unix commands that are run just before the shell gives you a prompt?
    a startup file
  22. What does an exit status of 0 mean?
    it means that the program encountered no errors
  23. Write a command line that will show every line in the file memo.txt that contains the word "hope" but NOT the word "bad".
    grep hope memo.txt | grep -v bad
  24. By default, where does Standard Output go?
    to the screen
  25. If you have write permission on a directory do you have write permission on the files it contains?
    no, you need write permission on each file