Sometimes, our tech gives us the silent treatment. An app freezes, a background task seems stuck, and your computer feels sluggish. When this happens, a simple restart might clear things up. But for those running Linux, there’s a powerful way to take control. You can directly manage what your system is doing. This skill is vital for anyone who truly wants to understand and master their machine.
To peek behind the curtain and see every process running, we use the ps command. This command stands for "process statistics." It shows you a snapshot of all the programs and tasks working on your system right now. A common way to use it is with the aux options, like this: ps aux.
ppinto@koala:~$ ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 1.6 0.3 2532 1372 1 Ss 13:56 0:01 /sbin/init root 2 0.0 0.0 0 0 1 S< 13:56 0:00 [kthreadd] root 3 0.0 0.0 0 0 1 S< 13:56 0:00 [migration/0] |
This output might seem like a jumble of letters and numbers at first. But each column tells an important part of the story about your running processes:
- USER shows which user started the process.
- PID is the process ID number, a unique tag for each task.
- %CPU tells you how much of your computer’s brain (CPU) the process is using right now.
- %MEM shows how much of your computer’s short-term memory (RAM) it is taking up.
- VSZ indicates the virtual memory size the process uses.
- RSS reports the actual physical memory (RAM) used in kilobytes.
- TTY points to the terminal where the process is running.
- STAT describes the current state of the process (e.g., S for sleeping, R for running, Z for zombie).
- START shows the time the process began.
- TIME tracks the total CPU time the process has used since it started.
- COMMAND reveals the actual command that launched the process.
The ps command has other ways to show information. You can use options like ps -e, ps -ef, ps -eF, or ps -ely to get different views. These provide more or less detail depending on what you need to see.
ps -e ps -ef ps -eF ps -ely |
Taking Down a Process
Once you’ve found a misbehaving process using ps, you might need to stop it. This is where the kill command comes in. It sends "signals" to processes, telling them what to do. By default, kill sends a "terminate" signal (TERM), which asks the process to shut down gracefully. Think of it like politely asking an app to close.
Sometimes, a polite request isn’t enough. If a process is truly stuck, you might need to send a stronger signal. The "KILL" signal, also known as signal 9, forces the process to stop immediately. It doesn’t give the process a chance to save its work or clean up. This is a last resort for stubborn applications.
Here’s how you might use kill to stop a process with a specific PID (Process ID), like 315:
Kill -KILL 315 ou kill -9 315 |
To see a full list of all the signals you can send with the kill command, just type kill -l. It will show you all the different ways you can talk to a process.
For situations where you want to stop all instances of a specific program, the killall command is your friend. Instead of needing to find each PID, you can simply tell killall the name of the program. For example, if you wanted to close all running instances of the vi text editor, you could use killall vi. This is a handy shortcut for when multiple copies of a program are causing trouble.
Understanding these simple commands gives you a new level of control over your Linux system. When an application misbehaves, you no longer feel helpless. You have the tools to identify the problem and put it out of its misery, quickly and effectively. It’s like being able to perform a quick repair without having to restart your whole machine. Mastering these basics is a solid step toward becoming a true Linux power user.

