Kangry.com [insert cool graphic here]
home | Topics | Logout | Search | Contact | ?? Kangry ?? | Bandwitdh
Topics:
DVR
nvrec
Mplayer
Links
Misc
Commands
Humor

Name

Password

New user

uploaded files
(linux_command_line)-> linux command show programs running submited by Russell Fri 16 Dec 05
Edited Mon 19 Dec 05
Web kangry.com
In responce to a hit from this search I provide the folowing:

$ ps   Provides a list of commands running under this process. 
  PID TTY          TIME CMD
12845 pts/0    00:00:00 bash
12871 pts/0    00:00:00 ps
To get a list of all commands running from the current user use:

$  ps xf    
  PID TTY      STAT   TIME COMMAND
12844 ?        S      0:00 sshd: russell@pts/0
12845 pts/0    Ss     0:00  \_ -bash
12872 pts/0    R+     0:00      \_ ps xf
Simple graphical lines indicate parrent child relationships. (that's the f option )
For a detailed list of all processes on the system with details on each process use:

$ ps uaxf   
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  2020  192 ?        S    Nov09   0:03 init [3]
root         2  0.0  0.0     0    0 ?        SN   Nov09   0:13 [ksoftirqd/0]
root         3  0.0  0.0     0    0 ?        S<   Nov09   0:00 [events/0]
root         4  0.0  0.0     0    0 ?        S<   Nov09   0:00  \_ [khelper]
root         5  0.0  0.0     0    0 ?        S<   Nov09   0:00  \_ [kblockd/0]
root        28  0.0  0.0     0    0 ?        S    Nov09   0:43  \_ [pdflush]
root        29  0.0  0.0     0    0 ?        S    Nov09   0:47  \_ [pdflush]
root        31  0.0  0.0     0    0 ?        S<   Nov09   0:00  \_ [aio/0]
root       192  0.0  0.0     0    0 ?        S<   Nov09   0:00  \_ [kmirrord/0]
root         6  0.0  0.0     0    0 ?        S    Nov09   0:00 [khubd]
..........
For a continuous updating list use top which provides an updating list of processes. I use the shift-C command to list by CPU usage. This puts the most active processes on the top of the list.

top - 14:51:41 up 36 days, 21:40,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  95 total,   1 running,  94 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3% us,  0.7% sy,  0.0% ni, 99.0% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:    157704k total,   156056k used,     1648k free,    44304k buffers
Swap:   327672k total,    21072k used,   306600k free,    31024k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
12908 russell   17   0  2064  952  756 R  0.7  0.6   0:00.17 top
    1 root      16   0  2020  192  164 S  0.0  0.1   0:03.20 init
    2 root      34  19     0    0    0 S  0.0  0.0   0:13.16 ksoftirqd/0
    3 root       5 -10     0    0    0 S  0.0  0.0   0:00.72 events/0



Replys: