Contents / Previous / Next


Processes

Usually many processes of different users run
on one host computer (on one or more CPUs) in parallel.


top: Display top CPU processes.

Top provides an ongoing look at processor activity in real time.
Keys:

   q : Quit
   h : Help

Example:

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
 1164 root      15   0 60956  11M  4212 S     0.5  2.2   0:38 X
 2779 felix     15   0  6616 6612  5332 S     0.3  1.2   0:08 metacity
25198 felix     15   0   964  964   756 R     0.3  0.1   0:00 top
  272 root      15   0  1476 1476   828 S     0.1  0.2   0:00 isdnlog
    1 root      15   0   236  236   204 S     0.0  0.0   0:04 init


ps: report process status

Options:

   -l : long format
   -e : select all processes
   -u (-U): user ID or name

Example:

> ps -l -u root

  F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
004 S     0     1     0  0  75   0 -   112 schedu ?        00:00:04 init
002 S     0     2     1  0  75   0 -     0 contex ?        00:00:00 keventd
002 S     0     3     1  0  94  19 -     0 ksofti ?        00:00:00 ksoftirqd_CPU0
022 S     0     4     1  0  85   0 -     0 kswapd ?        00:00:00 kswapd
002 S     0     5     1  0  85   0 -     0 bdflus ?        00:00:00
bdflush
.
.


kill: Terminate a process with signal s.

       kill -s  pid 

Example:

> kill -9 272


nice: Run a program with modified scheduling priority:

10 by default, range goes from -20 (highest priority) to 19 (lowest).

Example: (sleep 10 seconds with lowest priority)

nice -19 sleep 10