Lab04: The Unix File System


Objectives

     The goal of this lab is to become proficient with system commands
     for viewing the directories and different file types that make up a Unix
     filesystem.

Procedure

          To turn in for grading, answer the following questions.  Record your
     answers in a text file, one answer per line.  When you are done,
     copy your answers and paste them into a mail message to;
                jimg@opus.cabrillo.edu
     I will confirm that I have received it.

  1. Write down the absolute path of your home directory.

  2. /home/cis190/guest     (This would be guest's answer.)
  3. Relative to your home directory, what is the pathname of the tiger file in the Blake subdirectory?

  4. Poems/Blake/tiger
  5. What command allows you to see hidden files in your current directory?

  6. ls -a
  7. What command shows you your current working directory?

  8. pwd
  9. Are any of your hidden files directories?

  10. Yes, at least . and .. and maybe .ssh
  11. What does the cd command do when it is invoked with no arguments?

  12. It makes $HOME your current working directory
  13. Assuming you are in your home directory, what command will change your current working directory to the directory that holds Shakespeare's sonnets?

  14. cd Poems/Shakespeare   or  cd /home/CIS190/guest/Poems/Shakespeare
  15. What is the inode number of the /home/cis90 directory?

  16. 2395394
  17. Who is the owner of your home directory?

  18. You are, $LOGNAME
  19. What's the name of the largest text file in your home directory?

  20. bigfile  (or possibly mbox)
  21. What's the name and size of the smallest file in your home directory?

  22. empty  0 bytes
  23. How many subdirectories does the Poems directory have?

  24. Three:  Blake, Yeats, Shakespeare
  25. What is the first line of the file old in the Poems/Yeats directory?

  26. When you are old and grey and full of sleep,
  27. What is the last line of sonnet3 in the Shakespeare directory?

  28. Die single, and thine image dies with thee.
  29. Which files in you home directory should you not view with the cat or more commands?

  30. Any of your subdirectories, and what_am_i
  31. What key should you type when you want to exit from the more command?

  32. q
  33. What ls command allows you to see the permissions of your home directory?

  34. ls -ld $HOME
  35. What Unix command will allow you to look at the contents of a data file.

  36. xxd
  37. Extra Credit: With what command can you list all the hidden files, and only the hidden files of your home directory?      ls -d .* or echo .*
  38.