Thu 14 Sep 2006
If you want to list all active tasks (services) in Linux, use the ps command
| Syntax | Meaning |
|---|---|
| Process Selection | |
| a | select all processes on a terminal, including those of other users |
| g | select all processes on a terminal, including those of other users, even group leaders |
| r | restrict output to running processes |
| x | select processes without controlling ttys |
| --deselect | Invert selection |
| Output Formats | |
| j | Job control format |
| s | Display Signal format |
| u | Display User orientated format (CPU and Memory usage) |
| v | Display Virtual Memory format |
| l | Display Long format |
| w | Wide output |
Examples ps au, ps ax, ps xgwl, ps auw, ps grxwu
Many Linux systems run a super-server, or a software server that handles the initial stages of connection requests on behalf of other software servers. Super servers typically handle connections for small (or seldom-used) servers, such as Telnet, FTP, POP, IMAP, SWAT, SANE, and VNC, just to name a few. This is why these servers may not appear in your process list. These servers can be run standalone without the benefit of a super server, but running a super server typically results in reduced memory load when the servers it proxies for aren’t being accessed, albeit with some overhead and lag during connection attempts. (Some servers cannot be managed by a super server.) One big advantage of using a super-server is the extra layer of security it provides. A modern super-server, such as xinetd, includes built-in access control features that can limit access to subjugated servers.
Killing Processes There are dozens of ways to control processes. The first thing you need to do is obtain the pid using jobs or ps. Here are a few common ways to kill a process:
kill -STOP [pid] SIGSTOP (17,19,23) stops a process without killing it
kill -CONT [pid] SIGCONT (19,18,25)restarts a stopped process
kill -KILL [pid] SIGKILL (9) forces the process to terminate immediately and performs no cleanup
Jobs can also be stopped using Control-Z and then restarted using fg and bg. A list of active jobs can be obtained using jobs
fg [jobspec] - Resume jobspec in the foreground, and make it the current job.
bg [jobspec] - Resume the suspended job jobspec in the background, as if it had been started with &

