1. Assume there is a file named a_file in the current directory. Tell what each of the commands does from a user's perspective, and what each does in terms of inodes.

  1. cp a_file b_file
  2. mv a_file b_file
  3. ln a_file b_file

2. A compiler driver such as g++ invokes a sequence of other programs, depending on the command line options and file names specified by the user.

  1. List each of the programs that might be invoked by the compiler driver, and describe the type of information that the programs' input and output files would contain. Be as explicit as you can about the information in object files and executable files in your answer.
  2. Tell the complete sequence of programs the compiler driver would invoke for this command line: g++ ­g ­Wall file1.cc file2.cc file3.o ­o my_prog
  3. Tell the effect of each of the following compiler driver command line options: -c, -g, -I, -D, -l, -L, and -o.

3. Write a Makefile that would be appropriate for automating the construction of my_prog in the previous question, and explain what it would cause the make program to do.

4. Tell what the stat() system call does, and explain how make would use it to decide what to do.

5. Tell what the ci and co commands do, and tell what their -l command line option does.

6. Tell exactly what steps you would take to determine the value of a variable when some function is entered. You may not put any kind of output statement in your program.

7. Tell what the pmap, ldd, and nm commands do.

8. Tell what malloc() and sbrk() do, and explain their relationship.

9. Tell what fork() and exec() do, and explain their relationship.

10. Tell what printf() and write() do, and explain their relationship.