Lab 13

Back Up Next

horizontal rule

Home
Lab 1
Lab 2
Lab 3
Lab 4
Lab 5
Lab 6
Lab 7
Lab 8
Lab 9
Lab 10
Lab 11
Lab 12
Lab 13
Lab 14
Lab 15
Lab 16
Lab 17
Lab 18
Lab 19
Lab 20

Lab 13

(Chapter 13)

 

 


 

Learning Objectives

  1. To learn about attributes of UNIX processes
  2. To learn about foreground and background UNIX processes, including daemons
  3. To learn about sequential and parallel execution of UNIX commands
  4. To learn about suspending and terminating processes
  5. To learn about UNIX signals
  6. To learn about the UNIX process hierarchy on your system

Lab Work

  1. Log on to your UNIX system.
  2. How many processes are running on your system when you log on? What are the process IDs of the following processes and daemons: init, sched, cron, inetd. Show the session that you used to get the required information.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. Who are the parents of the sched, init, cron, and inetd processes? What are the process IDs of the parent processes? What are the priority numbers of sched, init, cron, and inetd? List these processes according to their priorities, with the highest priority process first. Show your session.

 

 

 

 

 

 

 

 

 

  1. How many HTTP server processes are running on your system? What are their process IDs? Use one command each for obtaining the above information. Show your session.

 

 

 

 

 

 

 

 

  1. How many sh, bash, csh, and tcsh processes are running on your system? Show your session.

 

 

 

 

 

 

 

 

 

 

  1. Monitor the CPU activity of your UNIX machine by using the top command. What kind of information does top display periodically and how often does it display this information? How many processes are running on your system at this time and how many of them are sleeping? Display information about all the processes belonging to a user on your system who is currently logged on? What are the priority numbers of these processes?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. Run the sessions shown in Section 13.6.1 on your system to practice foreground and background process creation, process suspension (with <Ctrl-Z>), switching processes from the foreground to the background (with the bg command) and vice versa (with the fg command). Use the jobs command to display job IDs of the active and suspended processes.

 

 

  1. Run a command that would remind you to leave for lunch after one hour by displaying the message “Time for Lunch!”. Show your command.

 

 

  1. Give a command line for running the find and sort command in parallel. The find command should display the pathname of the foobar file in your home directory and the sort command should sort data in smallFile (used in Chapter 10) by using GPA as the sort key. Ignore the leading white spaces between fields. For both find and sort, redirect errors to /dev/null. Output of the find command should go to find.out and that of the sort command should be redirected to the sort.out file. When the command line terminates, display the contents of find.out and sort.out. Show your session.

 

 

 

 

 

 

 

 

 

  1. Give one command each for terminating a process with ID 12345 and a job with ID 2.

 

 

 

  1. Execute command groups date and uname –a and who and ps in parallel. Show your session.

 

 

 

 

 

 

 

  1. You have a find command executing in the background looking for a file with inode number 123456 in the system. Right after executing the command, you realize that you actually wanted to look for a file with this inode number in your home directory and not in the whole system. How would you terminate this command? Show your work.

 

 

 

 

 

 

 

 

 

  1. Display the process hierarchy for your processes. Show your work.

 

 

 

 

 

 

 

 

 

  1. Log out.

 

 


 

 

horizontal rule

Back to CS140U Homepage
This page was last modified September 26, 2004
wmorales@pcc.edu