B.1. How can I list all the programs that are running, and kill a troublesome one?
Just as Windows users hit CtrlAlt Del
to show the Task Manager, Fedora users can access Applications > System Tools > System Monitor
to start the System Monitor. This tool allows you very simply to select a process; hit End Process to kill it.
If you prefer to work from the command line, you can list all the processes running on the machine using the ps command:
[kermit@swinetrek ~]$ ps axu
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.4 1744 544 ? S Nov01 0:04 init [5]
root 2 0.0 0.0 0 0 ? SN Nov01 0:00 [ksofirq]
root 3 0.0 0.0 0 0 ? S Nov01 0:00 [watcdog]
root 4 0.0 0.0 0 0 ? S< Nov01 0:00 [evens/0]
root 5 0.0 0.0 0 0 ? S< Nov01 0:00 [khelper]
…
kermit 2447 0.0 3.4 22196 4300 ? S Nov01 0:10 /usr/libe
snort 2516 0.2 9.2 50544 11624 ? Ss Nov01 0:48 /usr/sbin
root 28872 0.0 2.2 10864 2868 ? S Nov01 0:01 smbd -D
root 29809 0.0 1.7 7248 2260 ? Ss Nov01 0:00 sshd: ker
kermit 29812 0.0 1.8 7248 2332 ? S Nov01 0:00 sshd: ker
kermit 29813 0.0 1.1 4384 1408 pts/1 Ss Nov01 0:00 -bash
kermit 30227 0.0 0.7 4488 936 pts/1 R+ 00:46 0:00 ps axu
[kermit@swinetrek ~]$
To search for a particular process, use grep
on the output of ps:
[kermit@swinetrek ~]$ ps axu | grep snort
snort 2516 0.2 9.2 50544 9636 ? Ss Nov01 0:48
/usr/sbin/snort -A fast -b -d -D -i eth0 -u snort -g snort
-c /etc/snort/snort.conf -l /var/log/snort
kermit 30403 0.0 0.3 3732 384 pts/1 R+ 01:01 0:00
grep snort
[kermit@swinetrek ~]$
The second column2516 in the above exampleidentifies the process ID. Kill the process by passing that process ID to the kill command:
[root@swinetrek kermit]# kill 2516
[root@swinetrek kermit]#
|