Cabrillo College


Objectives

This lab will give you review exercises in UNIX commands, file systems, processes, and shell scripting. This will help you prepare for the final exam.


Forum

If you get stuck, have a question or want to share something you learned with this lab then use the CIS 90 Forum at http://simms-teach.com/forum/viewforum.php?f=9

Procedure

Log into your home directory on Opus, and make a subdirectory called review. Perform the following tasks and place the results of any steps of your work into this directory.


  1. The UNIX operating system is often divided into three parts:
    • The kernel (/boot/vmlinuz*)
    • The shells (/bin/*sh)
    • The commands (/bin/* /usr/bin/*)
    Make one file, called unix, that contains a long listing of all these files. Make sure this unix file ends up in your review directory. (See if you can avoid duplicating any filenames in your list.)
  2. Copy the output of the man page for the banner command to a file called banner.
  3. Find a way to list all the files in and under your home directory and save the output to a file called myfiles.
  4. Find the file, linux.words; it's somewhere on the system. Record its absolute pathname in a file called, news.
  5. Using the /etc/passwd file, mail yourself a list of all the accounts that are set up for CIS 90. Then read your mail and save that message to a file called mail90 in your review directory.
  6. See if you can figure out a way to run the banner command on the output of the date command. Save the results to a file called today.
  7. Save a list of all processes currently being run by root to a file called processes. vi this file and remove any lines that contain a process whose name does not end in the letter 'd'.
  8. You should now have 7 files in your review directory. Write a shell script that will let me view these files one at a time. The shell script should let me view the files as many times as I want before exiting the program. I want to be able to run this program from anywhere on the system. Once you have tested and debugged this program, copy it to the directory /home/rsimms/cis90/ naming it labx1.$LOGNAME. Make sure it is executable for me and that I can read your files. (I am a member of the cis90 group).

Congratulations! You've completed the Extra Credit Lab!