Lab 3: More UNIX:

Provide your answers in the spaces next to the questions. To begin, create a directory lab3/ in your home directory, then cd to it.

  1. (preliminary) Download (save link/page ) the file rasmol to your home directory. This is a program to visualize biomolecules.
  2. (preliminary) Download (save link/page ) the file 1BDD.pdb to your home directory. This is a biomolecule - a protein from staphylococcus bacterium. (Don't worry, in electronic form it is harmless.) IMPORTANT: This exercise will work best if you download the above (Linux) executable directly on your laptop. Intense graphical applications are typically slow when done over the internet. Linux/Mac users can try to ssh -Y (or -X) directly onto the lab machine, but as I said, the graphics will probably be slow. Windows users who did not yet install Linux are stuck at this point. The only possible solution is to download a windows version of rasmol that is called raswin .
  3. (preliminary) Create a directory structure under lab3 as follows (the names with a / are directories and all others are files). Take care to pay attention to the indentation, which reflects the nesting of subdirectories.
  4. midwest/
  5. eastcoast/
  6. illinois/
  7. northwestern
  8. indiana/
  9. purdue
  10. notredame
  11. westcoast/
  12. california/
  13. berkeley
  14. stanford
  15. rockies/
  16. (2 points) By mistake, the midwestern states and their universities have been listed under eastcoast. We are now trying to move the misplaced directories and their contents together to the correct location, so that the directory structure looks like:
  17. midwest/
  18. illinois/
  19. northwestern
  20. indiana/
  21. purdue
  22. notredame
  23. eastcoast/
  24. westcoast/
  25. california/
  26. berkeley
  27. stanford
  28. rockies/
  29. Write a mv command to achieve the desired effect. Note that the mv command implicitly recurses through the given arguments so you can move entire directory trees (in contrast, the cp and rm commands require the -r option to recursively copy to a new location or recursively delete from a given location). Before answering this question, first cd into the lab3 directory. Then type your mv command from here. Write your command here below.
     
  30. (4 points) Once again assume that you are now in the lab3 top-level directory. Write ls commands to list : You can assume that states are those directories at the second level of nesting. The regular expressions that you concoct must perform their intended roles in any directory system, not just for the example directory system given here. You are also not allowed to solve the questions yourself and explicitly list the answers in the ls command.
  31. (2 points) Create two files called oldfile and newfile. Put some random text in each of them. Make sure the contents are different so that it will help you in debugging and understanding what is to follow. Then explain what each of the following four commands below do.

    (In answering this question, it will help you to inspect the contents of the relevant files both before and after the command is executed, so that you can systematically try to infer what is going on.)