Cabrillo College


In this lab you will use the ps command to monitor processes as you create them using UNIX commands.


If you get stuck, have a question or want to share something you learned with this lab then use the CIS 90 Forum at


Log on to Opus so that you have a command line shell at your service. Be sure you are in your home directory to start this lab.

  1. Run the C shell program csh. Then run the Bourne shell sh. Run the ps command to see that you have three shell processes running.
  2. Run the ps command with the -l option. Look at the column headed by the symbol SZ. This is the size of the process in 1K blocks. Which of the three shells that you are running is the largest? Redirect that line of output to the file bigshell.
  3. Now terminate the Bourne and C shells by typing the exit command twice.
  4. Run the ps command with the -ef option. What is the parent of your shell process? The Grandparent? The Great Grandparent?
  5. What is the name of the program with the PID of 1? (What is its parent)?
  6. Run the app command in the foreground.
  7. Notice that you are stuck. Bring up another window on opus and kill this process.
    Hint: use the command ps -u $LOGNAME to find the pid number.
  8. Run the app command in the background by adding a & on the command line
    (Hit the Enter key to get your prompt back)
  9. Now try to log out by entering the exit command. What does the shell say?
  10. Enter exit again, and then log back in. Use ps to check on the app process. Is it there? What happened?
  11. This time enter the following command:
    find $HOME   > files.out   2>/dev/null   &
  12. We will now use the at command to submit the work you have just done. Since the find process may not be finished running yet, we will set the command to be executed just before midnight. The at command gets its input from stdin, so you will have to type the following lines:
    at 11:59pm
    at> cat files.out bigshell > lab08
    at> cp lab08 /home/rsimms/turnin/lab08.$LOGNAME      
    at> <Ctrl-D>
    Note: the Ctrl-D (hold down the Ctrl key and tap the D key) must be entered as the first character on the last line.
    If you get a warning message from the at command about using the Bourne shell to execute your job, that is ok. Tomorrow morning you should see the file, lab08 in your home directory.