Master Linux Process Management: Using ps, kill, and killall
This guide explains how Linux treats programs and daemons as processes, shows how to list them with ps using various options, demonstrates extracting Chromium process IDs, and provides safe techniques for terminating unwanted processes with kill, killall, and advanced options, while warning about careful use.
Understanding Linux Processes
In Linux every program and daemon runs as a process. Each process consumes memory and CPU cycles, so the more processes you run, the higher the resource usage. On older or low‑power machines (e.g., a 7‑year‑old laptop or a Raspberry Pi) monitoring background processes can help you make the most of limited resources.
Listing Processes with ps
The ps command displays currently running processes. Common options are: -e – show every process -f – full‑format listing with additional columns
Examples:
$ ps -e -f PID TTY TIME CMD
88000 pts/0 00:00:00 bash
88052 pts/0 00:00:00 ps
88053 pts/0 00:00:00 head $ ps -e | head PID TTY TIME CMD
1 ? 00:00:50 systemd
2 ? 00:00:00 kthreadd
3 ? 00:00:00 rcu_gp
4 ? 00:00:00 rcu_par_gp $ ps -ef | head UID PID PPID C STIME TTY TIME CMD
root 10013 51 0 00:00:50 /usr/lib/systemd/systemd --switched-root --system --deserialize 36
root 20013 51 0 00:00:00 [kthreadd]
root 32013 51 0 00:00:00 [rcu_gp]
root 42013 51 0 00:00:00 [rcu_par_gp]Interpreting ps Output
Key columns include: UID – user that owns the process PID – numeric process identifier PPID – parent process identifier
Process numbering starts at 1; the first user‑space process is systemd (PID 1), which spawns kthreadd, and that in turn creates other kernel threads such as rcu_gp and rcu_par_gp.
Terminating Processes with kill
When a program like Chromium leaves many background processes after you close the UI, you can terminate them with kill. First obtain the PIDs, then feed them to kill:
$ ps -ef | fgrep /usr/lib64/chromium-browser/chromium-browser | awk '{print $2}' > /tmp/pids
$ kill $(cat /tmp/pids)The first command extracts all Chromium process IDs; the second kills each of them in one shot.
Using killall for Bulk Termination
The killall command can terminate every process whose executable name matches a pattern, providing a quicker way to stop many similar processes: $ killall chromium-browser Because killall matches by name, it is advisable to first verify the target processes with ps -ef. killall also supports useful options: -i or --interactive – prompt before killing each process -o or --older-than – select processes older than a given time -y or --young-than – select processes newer than a given time
Alternative Management via Chromium Settings
Instead of killing processes manually, Chromium provides a built‑in setting to control background activity. Disabling “Continue running background apps when Chromium is closed” stops the extra processes from persisting after you exit the browser.
Regularly checking which processes are running and intervening when necessary remains a good practice for system stability.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
