CA170 - Introduction to Operating Systems

Answer all multiple-choice questions. 1 mark each. There is no negative marking.

  1. What is this script doing?

    grep string file > /dev/null
    if test "$?" = "0"
    then
    ...






  2. In my Shakespeare directory, you want to count on how many lines the string "King" appears in Shakespeare. Which of the following will answer that question?










  3. One of the following file protections will break your web page:









  4. Which of the following fails to find lines containing "Scotland" in a group of files?






  5. As a result of the "unused RAM is wasted RAM" idea, we may:








  6. This shell conditional:
    if test "$1" = "1"
    is true if:







  7. This character should be avoided in Unix filenames:







  8. This command:
    sed -e 's|<|\&lt;|g'







  9. On Linux, when you type a normal command, it should be in the PATH to run. Yet when you run ps -f you see a program running that is not in the PATH. How can this happen?








  10. Swapping a process or part of a process to disk works with:






  11. With compile-time binding, the memory locations used can be changed if the program is re-compiled. Why does the OS not do this?






  12. In a modern OS, one of these is false:









  13. I am in the directory   /stuff/and/things   and I type:   cd ../../../more/things   - What directory am I in now?







  14. You write a simple program in assembly language (or "machine code", or "native instructions"). You then want to run the program on a different type of machine (different chip). Which is normally true:






  15. I am in the directory   /stuff/and/things   and I type:   cd more/things   - What directory am I in now?







  16. Linux dominates supercomputers and other specialist computer niches because:









  17. One of these is true.









  18. This program:
    // define a function:
    function f() { f(); } // function calls itself
    // start the program:
    f();







  19. The relationship of Paging to Swapping is:








  20. The commands "cd" followed by "cd public_html" followed by "mkdir ../stuff" make a directory called:








  21. We are searching for text in chapters of a book, called names like chap17.html. One of these is definitely not right:










  22. A program is a stream of instructions to be executed. When an OS runs a program, it starts the CPU executing that stream of instructions. How does the OS ever get control of the machine back?







  23. What will this Shell script do?

    for i in *
    do
    rm i
    done








  24. When we run multiple programs at the same time, we need:







  25. On a multi-user system, when one user's program divides by zero: