LINUX
COMMANDS
Contents | Previous
| Next
Process management
Each time you run a command or application, you start a
process. Each process is given a unique number; called
its process ID (PID).
To determine which processes are hogging resources (CPU
time and memory), and to kill a rogue process, you have
at your disposal the commands, ps, kill,
and top.
$ ps - process
ps
Display processes running in current shell session.
| $ ps |
| |
PID |
|
TTY |
|
TIME |
|
CMD |
| |
1485 |
|
tty2 |
|
00:00:00 |
|
bash |
| |
1531 |
|
tty2 |
|
00:00:00 |
|
ps |
| $ |
|
|
TTY is short for teletype (once a major manufacturer
of Unix terminals). Here the second console (tty2) is being
used. In a (second) terminal window this would appear as
pts/2. TIME is the total CPU time spent
on the process.
ps aux
Display every process, by all users. (a to display
all processes running from a terminal, u to display
username with process, x to display all processes
not running from a terminal.)
ps aux | grep bash
Display every 'bash' process. Ideal for obtaining
the PID in order to kill a rogue process.
$ kill
kill 101
Kill the process with the PID, 101.
$ top
top
Display processes in realtime. Handy for determining what's
hogging your CPU and memory.
Contents | Previous
| Next