Menu

UNIX TUTORIALS - Unix - Processes

Unix - Processes

ADVERTISEMENTS

Listing Running Processes:

ColumnDescription
UIDUser ID that this process belongs to (the person running it).
PIDProcess ID.
PPIDParent process ID (the ID of the process that started it).
CCPU utilization of process.
STIMEProcess start time.
TTYTerminal type associated with the process
TIMECPU time taken by the process.
CMDThe command that started this process.

ADVERTISEMENTS

OptionDescription
-aShows information about all users
-xShows information about processes without terminals.
-uShows additional information like -f option.
-eDisplay extended information.

ADVERTISEMENTS

Foreground Processes:

$ls ch*.doc

ch01-1.doc   ch010.doc  ch02.doc    ch03-2.doc 
ch04-1.doc   ch040.doc  ch05.doc    ch06-2.doc
ch01-2.doc   ch02-1.doc

Background Processes:

$ls ch*.doc &

ch01-1.doc   ch010.doc  ch02.doc    ch03-2.doc 
ch04-1.doc   ch040.doc  ch05.doc    ch06-2.doc
ch01-2.doc   ch02-1.doc

[1]   +   Done                 ls ch*.doc &
$

Listing Running Processes:

$ps
PID       TTY      TIME        CMD
18358     ttyp3    00:00:00    sh
18361     ttyp3    00:01:31    abiword
18789     ttyp3    00:00:00    ps

$ps -f
UID      PID  PPID C STIME    TTY   TIME CMD
amrood   6738 3662 0 10:23:03 pts/6 0:00 first_one
amrood   6739 3662 0 10:22:54 pts/6 0:00 second_one
amrood   3662 3657 0 08:10:53 pts/6 0:00 -ksh
amrood   6892 3662 4 10:51:50 pts/6 0:00 ps -f

Stopping Processes:

$ps -f
UID      PID  PPID C STIME    TTY   TIME CMD
amrood   6738 3662 0 10:23:03 pts/6 0:00 first_one
amrood   6739 3662 0 10:22:54 pts/6 0:00 second_one
amrood   3662 3657 0 08:10:53 pts/6 0:00 -ksh
amrood   6892 3662 4 10:51:50 pts/6 0:00 ps -f
$kill 6738
Terminated

$kill -9 6738
Terminated

The top Command:

$top