Processes
Every program you run becomes a process: a running instance with its own memory, its own user, and its own life cycle. Understanding processes is how you go from “the terminal is a place I type commands” to “the terminal is a system I control” — you can see what is running, steer what comes next, kill what has gone wrong, and keep things running after you log out.
This section covers the process toolkit. ps and top show what is running right now; htop shows it in color. kill, killall, pkill, and pgrep let you stop things by name or by process ID. jobs, bg, and fg manage the programs your shell is juggling. nice and renice control how much CPU a program gets, and nohup and wait keep programs alive and in sync. For the deeper tools — lsof, strace, ltrace — and for the system that starts everything at boot, see systemd Units.
Common Process Tools
| Command | What It Does |
|---|---|
ps | Report a snapshot of current processes. |
top | Watch processes live in the terminal. |
htop | A colorful, interactive upgrade to top. |
kill | Send a signal to a process by PID. |
killall | Kill processes by name. |
pkill | Kill processes matching a pattern. |
pgrep | Find process IDs matching a pattern. |
jobs | List the shell’s background jobs. |
bg | Resume a stopped job in the background. |
fg | Bring a job back to the foreground. |
nice | Run a command with a chosen CPU priority. |
renice | Change the priority of a running process. |
nohup | Run a command immune to hangups. |
wait | Pause until background jobs finish. |
lsof | List which files and sockets processes have open. |
strace | Trace a program’s system calls. |
ltrace | Trace a program’s library calls. |
| systemd units | Services, timers, and the tools that manage them. |
Why This Matters
- Servers break in the background. A process stuck in a loop or holding a port needs to be found and killed — by PID, by name, or by pattern.
- Long jobs outlive your login.
nohup, background jobs, and systemd units are how work keeps running after you close the terminal. - Everything you type becomes a process. The shell,
ls,grep, every editor — process tools are how you observe the machine itself.
Learn this section and you can answer the two questions every Linux admin eventually faces: what is running on this machine? and how do I make it stop?