4.4 About Me4 Labs4.2 Some Unix commands4.3 Browsing, the file system, and re-direction

4.3 Browsing, the file system, and re-direction

The purpose of this lab is to get some familiarity with the UNIX file system. Like the last lab, please take some time with this. There is LOTS to learn here.
  1. Log on to the system.
  2. TABER CIS137-- Lab: 4.3
    Name:





    Issue the pwd command. This will show you your path to your current working directory. This is an important concept. If you don't specify otherwise, this command will shows you where relative file names start from and the default location of files you create.

    What directory did you get?





  3. Issue the command cd ..
    Note: The space between "cd" & "..". Again issue the pwd. Where are you now?




  4. Do question 4.3 again. What directory did you get?




  5. Do question 4.3 again. What directory did you get?




  6. Well enough of that. Now try:
    username@gort ~ $ cd
    username@gort ~ $ pwd
    
    Where are you now?




  7. Next an absolute reference. This directory name will start with a "/". Please note that the return value from the pwd command is an absolute reference.
    username@gort ~ $ cd /usr/bin
    username@gort ~ $ ls -l 
    
    Did you get that? That list of files is just some of the executable programs available to you this semester. One of the "problems" with todays computers and the attached displays is that they are so fast. Unix (and other) systems provide programs for slowing down the output. The "standard" Unix command to do this is more. On gort, many Unix systems and Posix systems less will also be installed. Both function in very much the same way.

     

    Re-direct the output of the above command into less.

    username@gort ~ $ ls -l /usr/bin | less
    
    What is the file size of that strange file named "["?




  8. Type in a "h" (for help). What does the letter "q" do?




  9. Leave the help screen with a "q" (After you have read it). Search forward for head. What is the size of the executable?




  10. Go to another user's home directory, cis137. This user is one that I will use to distribute files this semester. The "~" at the beginning of a file name specifies a user directory. You can use the charater sequence "~/" to refer to your home directory.
    username@gort ~ $ cd ~cis137
    
    How large is the bourne.script file?




  11. Change back to your home directory. Do you remember how? look at the file .welcome What does it say?




  12. username@gort ~ $ wc .welcome
    
    How many lines words and characters does it have in it?




  13. Use re-direction:
    username@gort ~ $ cat .welcome | wc
    
    How is the output different?




  14. Look at:
    username@gort ~ $ man 7 hier
    
    Notice that you are in the paging program. less or more. What is the /home directory used for?




  15. Log off
Turn in this sections pages with your answers (or a copy). Please turn your lab to Louis Taber or to Pima Community College employee in room A-115 of the Santa Rita Building. Ask them to place it in the dark blue folder in Louis Taber's mailbox.
Instructor: ltaber@pima.edu ** My new Home at GeoApps in Tucson ** The Pima College Site

4.4 About Me4 Labs4.2 Some Unix commands4.3 Browsing, the file system, and re-direction