E-Mail:

Monitoring System Processes

  • No Related Post

Monitoring System Processes

Ever wonder what’s going on behind the scenes in your computer? What processes are running? What state are those processes in? How much CPU time are they taking? Linux offers a variety of tools to view this data on your machine. You can view a snapshot, or you can take a real-time interactive view - it’s up to you.

For a snapshot of active processes, use the ps command. ps checks the active processes at the time the command is invoked, and prints the results to the screen. With a fist full of command line options, ps can be tweaked to display only the exact information you’re looking for.

  ps
  PID TTY TIME CMD
  4099 pts/2 00:00:00 bash
  4105 pts/2 00:00:00 ps

This example shows the results of a simple ps command. The output from the command shows the process ID (PID) terminal (TTY), CPU time (TIME), and the command (CMD) used to execute each running process. Remember, these are only the active processes. They don’t include any that are sleeping or zombied - processes that result from a parent process forgetting to call “wait” to the child.

As always, ps carries with it some interesting and useful command line options that will broaden or sharpen your snapshot, depending on your needs.

Option Result
a list all processes
e include environment
l produce a long listing
t tty display only processes running on tty
x include processes without an associated terminal

These options can be combined in any number of ways to customize the output of your ps command.

On Monday, we’ll look at another view of system processes that’s a great tool for system administrators: top.

One Comment

Just what I was looking for. Very clutch. Thankyou.

What Do You Think?

 
53 queries / 0.122 seconds.