Module 4: The system
Processes: ps and kill
Everything running on a system is a process with a number, its PID. Here you'll find one that shouldn't be running, and stop it the polite way.
● Runs 100% in your browser. Nothing here can harm a real system.
Step 1 of 6
What's running?
ps aux lists every process on the system: who runs it, its PID, how much CPU and memory it uses, and its command.
Your task
List every running process.
guest@ohsudo: ~ — Ubuntu 24.04
Starting the terminal…
What you'll practice
- What's running?.
ps auxlists every process on the system: who runs it, its PID, how much CPU and memory it uses, and its command. - Find one. On a real server that list is long, so pipe it into
grep. - Stop it.
killsends a signal to a PID. By default, that signal asks the process to clean up and exit.kill -9forces it, which is for when that fails, as the process gets no chance to save anything. - Check it's gone. Always check. A process that keeps coming back is usually being restarted by something else.
- Not yours. You can only signal your own processes. For anyone else's, you need
sudo. PID 911 is Nginx, which runs as root. - Services are different. Don't
killa service, as systemd may just start it again. For anything systemd runs, usesystemctl. The next lesson covers that.